on 2013 Dec 11 3:55 PM
Has anyone else had this problem? I was trying to use the internal function uInt8ToDate function. The parameters, according to SAP's documentation, allow you to add a "True" option to the call which makes the function convert the date to local time. The default converts the date to UTC time. The call would look like this:
var result = UserFunc.uInt8ToDate(Par,True)
Whenever I try to do this, I get an error. If I exclude the "True" and let the function default to "False", it works fine, i.e.:
var result = UserFunc.uInt8ToDate(Par)
Why doesn't this switch to convert to local time work? The contract I'm working on right now is a global company so converting to local time won't hold me up at all but I'm just curious why this feature is documented by SAP as a functional option but doesn't work in practice. Thanks.
While I never did find the actual answer to this question, I did find a workaround. You can use the JavaScript "new Date()" function to convert the string uInt8ToDate returns into an actual date object. By default, uInt8ToDate returns the date as a string.
var result = new Date(UserFunc.uInt8ToDate(Par))
Once it's an actual date object, you can use Date's other built in functions to convert to local time. Again, not an answer as to why the "True" switch doesn't work but a viable workaround.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
10 | |
10 | |
10 | |
10 | |
8 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.