formatdate()

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
kiwichick
Posts: 738
Joined: 08 Aug 2012 04:14
Location: Pahiatua, New Zealand

formatdate()

Post by kiwichick »

Hi, I've just been checking out the examples in the help file but none of them work for me when the date is provided. They just throw an "Invalid date" error. I'm not aware of anything unusual in my system's date/time setup. It's the same as the dd.mm.yyyy format used in the examples.
Windows 10 Pro 22H2
Scaling 150%

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: formatdate()

Post by highend »

text formatdate("16.08.2009"); throws an error?

What does text <date>; output then?
One of my scripts helped you out? Please donate via Paypal

kiwichick
Posts: 738
Joined: 08 Aug 2012 04:14
Location: Pahiatua, New Zealand

Re: formatdate()

Post by kiwichick »

Thanks highend,
highend wrote: ↑29 Oct 2021 10:34 text formatdate("16.08.2009"); throws an error?
Yes it does
2021-10-29_224441.png
What does text <date>; output then?
29/10/2021 10:45:00 pm
To see the attached files, you need to log into the forum.
Windows 10 Pro 22H2
Scaling 150%

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: formatdate()

Post by highend »

Reading...
date [optional] Date expression to be formatted.
Defaults to now.
The date expression should be formatted either in the current locale, or in the universal ISO 8601 format (YYYY-MM-DD hh:nn:ss).
date expression should be formatted either in the current locale, or in the universal ISO 8601 format

Your current locale does NOT use 16.08.2009 as the date format^^
One of my scripts helped you out? Please donate via Paypal

kiwichick
Posts: 738
Joined: 08 Aug 2012 04:14
Location: Pahiatua, New Zealand

Re: formatdate()

Post by kiwichick »

Ah I see now, I need to use "/" instead of "."
Windows 10 Pro 22H2
Scaling 150%

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: formatdate()

Post by highend »

As long as you don't think that 16/08/2009 would be correct...
One of my scripts helped you out? Please donate via Paypal

kiwichick
Posts: 738
Joined: 08 Aug 2012 04:14
Location: Pahiatua, New Zealand

Re: formatdate()

Post by kiwichick »

highend wrote: ↑29 Oct 2021 11:51 As long as you don't think that 16/08/2009 would be correct...
Sorry? I tried using that and it worked fine, throwing no errors. The following works as expected:

Code: Select all

text formatdate("16/08/2009", "Zodiac");
Or do you mean something else?
Windows 10 Pro 22H2
Scaling 150%

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: formatdate()

Post by highend »

I meant full (because it's missing a time component - which can be left out if not required), not correct
One of my scripts helped you out? Please donate via Paypal

kiwichick
Posts: 738
Joined: 08 Aug 2012 04:14
Location: Pahiatua, New Zealand

Re: formatdate()

Post by kiwichick »

highend wrote: ↑29 Oct 2021 11:59 I meant full (because it's missing a time component - which can be left out if not required), not correct
Gotcha, yes I see what you mean now :) Thanks for your help.
Windows 10 Pro 22H2
Scaling 150%

Post Reply