| View previous topic :: View next topic |
| Author |
Message |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Sun Apr 13, 2003 9:07 am Post subject: datetime |
|
|
Hi,
using @datetime(yyyy-mm-dd hh:nn:ss) is never a problem.
The problem comes up when working with specific date values
instead of the current date. Then it seem you have to know
the regional setting for date (mm.dd.yyyy, mm-dd-yyyy. etc).
I think it would be nice to get this through vds.
I know that I can read the separator, but it isn't the problem.
I can use "." and "-" in germany. The problem is to know
whats first (day or month).
Have a nice sunday
Bye, Fabian |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Sun Apr 13, 2003 9:25 am Post subject: |
|
|
fair enough fabian
Serge _________________
|
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Mon Apr 14, 2003 5:52 pm Post subject: |
|
|
I think that if the slash (/) separator is being used, the month is supposed
to come first and then the day, if using the dash, the day comes first and
only then the month, as in dd-mm-yyyy and mm/dd/yyyy.
I expect this script to work on any Windows version:
| Code: |
%%day = 14
%%month = 10
%%year = 2000
if @equal(@datetime(/),/)
%%date = %%month/%%day/%%year
else
%%date = %%day@datetime(/)%%month@datetime(/)%%year
end
info @datetime(dddddd,%%date)
|
|
|
| Back to top |
|
 |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Mon Apr 14, 2003 5:56 pm Post subject: datetime |
|
|
Hi Tommy,
nice to hear from you
Thanks for that info.
bye, Fabian |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Apr 14, 2003 9:43 pm Post subject: |
|
|
hi tommy,
sorry mate...no good on my ME running downunder...i get EXCEPTION: INVALID DATE/TIME
Serge _________________
|
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Mon Apr 14, 2003 9:48 pm Post subject: |
|
|
Then maybe it does somehow have the inappropriate mm-dd-yyyy format
set in the regional settings.
Maybe this will work:
| Code: |
%%day = 14
%%month = 10
%%year = 2000
if @equal(@pos(14,@datetime(ddddd,36813)),1)
rem day is first
%%date = %%day@datetime(/)%%month@datetime(/)%%year
else
rem month is first
%%date = %%month@datetime(/)%%day@datetime(/)%%year
end
info @datetime(dddddd,%%date)
exit
|
Last edited by Tommy on Tue Apr 15, 2003 7:19 pm; edited 1 time in total |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Apr 14, 2003 9:55 pm Post subject: |
|
|
perfect tommy
Serge _________________
|
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Apr 14, 2003 10:46 pm Post subject: |
|
|
Works here in too.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Tue Apr 15, 2003 6:24 am Post subject: datetime |
|
|
cool
you are my hero  |
|
| Back to top |
|
 |
|