Datus Posted January 29, 2009 Share Posted January 29, 2009 (edited) Trying to find a way to convert @YDAY variable (gives the day of the year) to a date eg YYYYMMDD Tried help and search forum but nothing so far. Any Idea's Background info. Reason I want to do this is to predict when a drive will fill. I find out how many days it will take to fill it then add it to @YDAY and then display that in a format anyone can understand. Edited January 29, 2009 by Datus We live as we dream alone! Link to comment Share on other sites More sharing options...
charvi Posted January 29, 2009 Share Posted January 29, 2009 This example can guide you to the right direction: #include <Date.au3> ; Julian date of today. $sJulDate = _DateToDayValue (2009, 01, 01) MsgBox(4096, "", "Todays Julian date is: " & $sJulDate) ; YDAY difference calculation Dim $Y, $M, $D $sJulDate = _DayValueToDate ($sJulDate+@YDAY-1, $Y, $M, $D) MsgBox(4096, "", "@YDAY difference from 2009-01-01: " & $Y & "/" & $M & "/" & $D) Link to comment Share on other sites More sharing options...
Datus Posted January 29, 2009 Author Share Posted January 29, 2009 Cheers works using the example given. Just wanted to make sure there wasnt an easier way. #include <Date.au3> ; Julian date of today $Daysleft=58 $sJulDate = _DateToDayValue (2009, 01, 01) MsgBox(4096, "", "Todays Julian date is: " & $sJulDate) $sJulDate = $sJulDate + $Daysleft ; YDAY difference calculation Dim $Y, $M, $D $sJulDate = _DayValueToDate ($sJulDate+@YDAY-1, $Y, $M, $D) MsgBox(4096, "", "@YDAY difference from 2009-01-01: " & $Y & "/" & $M & "/" & $D) We live as we dream alone! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now