Jump to content

Want to get Date from @YDAY [resolved]


Datus
 Share

Recommended Posts

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 by Datus

We live as we dream alone!

Link to comment
Share on other sites

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...