Page 1 of 1

Date() with a message I can't understand

Posted: 02 Nov 2017 23:05
by husky
Hello,


I'm running into some weird issues with

Code: Select all

 Date=(11/03/2017, 14, 00 , 00 , [color=#40FFFF]UTC or"UTC"[/color]);

I expected to get back the UTC date for the date and hour specified.

What I'm getting is :

1. Unsupported method getDate:with 5 arguments.
2. The String timezone at times is not accepted because it cannot be converted into a number.

I also tried to see what happens if I remove "UTC" argument.(keeping only 4 arguments)

I'm still getting the same message 1 above.

Any help is welcome.


Thanks

Husky

Re: Date() with a message I can't understand

Posted: 03 Nov 2017 20:46
by Martin
Hi,

I assume your code looks like this:

Code: Select all

getDate=(11/03/2017, 14, 00 , 00 , "UTC");
The first parameter specified in this way is just an integer division meaning 11 divided by 3 divided by 2017.
Something like this should work:

Code: Select all

date = getDate("11/03/2017 14:00:00 UTC", "MM/dd/yyyy HH:mm:ss z);
Regards,
Martin

Re: Date() with a message I can't understand

Posted: 04 Nov 2017 13:21
by husky
Hello Martin,


You assumed my code correctly.
Code: Select all
getDate=(11/03/2017, 14, 00 , 00 , "UTC");


Well, another lesson learned. I fought this problem really hard and from the Help, there is nothing to tell me that date must be enclosed between ".
probably a seasoned programmer would not fall into the same pit I did.

Fixed the getDate and now it works as expected. (kind of obvious after all).

Thank You very much

Best Regards

Peter