web analytics
How to format the date and time in vbscript Options
codeling
Posted: Wednesday, June 27, 2018 12:06:05 PM

Rank:Advanced Member
Groups: Member
Joined: 12/11/2015
Posts: 978
Points: 4113

The following code shows how to format the date and time in vbscript.

 

Dim TestStr

Dim date

date= now()

 

TestStr = year(date) & month(date) &  Right("0" & Day(date),2) & Right("0" & Hour(date),2) & Right("0" & Minute(date),2) & Right("0" & Second(date),2) & ".dat"

 

 

WScript.Echo TestStr

Sponsor
Posted: Wednesday, June 27, 2018 12:06:05 PM
 
Users browsing this topic
Guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.


© 2018 Digcode.com. All rights reserved.