Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Easy Date Format Question

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,61698
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Easy Date Format Question
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Easy Date Format Question - 6/22/2008 9:08:23 AM   
  rainsworth

 

Posts: 3
Score: 0
Joined: 6/15/2008
Status: offline
The current function I have in place for date functions is below.  My only question is on the formating.  Currently it will show a format of mmddyyyy.  How do I get it to truncate the year into 2 digit format rather than 4 digit?  Have tried several different thing's, but it seems to error out every time.  Appreciate the help.

Function FileDateNow
varYear = year(now)
varMonth = month(now)
if len(varMonth) = 1 then
 varMonth = "0" & varMonth
end if
varDay = day(now)
if len(varDay) = 1 then
 varDay = "0" & varDay
end if
FileDateNow = varMonth & varDay & varYear
End Function
 
 
Post #: 1
 
 RE: Easy Date Format Question - 6/22/2008 9:36:49 AM   
  dm_4ever


Posts: 2665
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
varYear = Right(year(now), 2)

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to rainsworth)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Easy Date Format Question Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts