Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Julian Date.

Status
Not open for further replies.

Phreeneazie

Technical User
Apr 6, 2003
27
GB
I have a need to work out "yesterdays" Julian date and then write that out to a file. Does anyone know how this could be achieved? At first I was thinking of just having a file that had the number incremented by 1 every day. Of course this wouldn't work due the need to reset it on Jan 1st back to 001 (plus the year incrementing by 1).

By Julian date, I mean an incrementing number starting on Jan 1st as 001...

03001
03002
03003 etc., etc. The first '03' being the year....

I should state the I'm newer to VBScript than a day old baby! So all help is very much appreciated.

Thanks!
 
jDate = cStr(right(year(date),2)) + cStr(datePart("y",date))

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
You can try something like this:
Code:
yesterday=Date-1
jul=Right(Year(yesterday),2)&DatePart("y",yesterday)
out="\path\to\output"
Set fso=CreateObject("Scripting.FileSystemObject")
Set tf=fso.OpenTextFile(out,2) 'ForWriting
tf.WriteLine jul
tf.Close

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top