| View previous topic :: View next topic |
| Author |
Message |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Tue Feb 03, 2009 1:53 am Post subject: Date conversion? |
|
|
Anyone know an easy way to convert the following without creating a list of all the months with their associated number?
Feb 2 2009 --> 02/02/2009
BTW - I already tried @datetime(mm/dd/yyyy,Feb 2 2009)
Thanks in advance... |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Tue Feb 03, 2009 8:46 am Post subject: |
|
|
Maybe timedate.dll can do it? _________________ cheers
Dave |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Feb 03, 2009 5:03 pm Post subject: |
|
|
Try this code
| Code: |
:MonthToNum
# Function to convert a date formated as Feb 2 2009 --> 02/02/2009
%R =
%%OldSep = @fsep()
Option FieldSep,@chr(32)
Parse "%%Month;%%Daynum;%%Year",%1
If @less(%%Daynum,10)
%%Daynum = 0%%Daynum
End
If @Equal(%%Month,Jan)
%R = 01/%%Daynum/%%Year
ElsIf @Equal(%%Month,Feb)
%R = 02/%%Daynum/%%Year
ElsIf @Equal(%%Month,Mar)
%R = 03/%%Daynum/%%Year
ElsIf @Equal(%%Month,Apr)
%R = 04/%%Daynum/%%Year
ElsIf @Equal(%%Month,May)
%R = 05/%%Daynum/%%Year
ElsIf @Equal(%%Month,Jun)
%R = 06/%%Daynum/%%Year
ElsIf @Equal(%%Month,Jul)
%R = 07/%%Daynum/%%Year
ElsIf @Equal(%%Month,Aug)
%R = 08/%%Daynum/%%Year
ElsIf @Equal(%%Month,Sep)
%R = 09/%%Daynum/%%Year
ElsIf @Equal(%%Month,Oct)
%R = 10/%%Daynum/%%Year
ElsIf @Equal(%%Month,Nov)
%R = 11/%%Daynum/%%Year
ElsIf @Equal(%%Month,Dec)
%R = 12/%%Daynum/%%Year
End
Option FieldSep,%%OldSep
Exit %R
|
No DLL or VDS List required _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Tue Feb 03, 2009 6:05 pm Post subject: |
|
|
Thanks to both of you for the suggestions.
Timedate.dll didn't help
Hehe... Well, Dragonsphere, I did say without using a list didn't I
Looks like Dragonsphere's way will have to too.
Thanks again  |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|