forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Date conversion?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Tue Feb 03, 2009 1:53 am    Post subject: Date conversion? Reply with quote

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) Confused

Thanks in advance...
Back to top
View user's profile Send private message Send e-mail
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Tue Feb 03, 2009 8:46 am    Post subject: Reply with quote

Maybe timedate.dll can do it?
_________________
cheers

Dave
Back to top
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Tue Feb 03, 2009 5:03 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Tue Feb 03, 2009 6:05 pm    Post subject: Reply with quote

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 Rolling Eyes

Looks like Dragonsphere's way will have to too.

Thanks again Wink
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group