# Want to get Date from @YDAY [resolved]

## 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!

##### 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)```

##### 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!

## Create an account

Register a new account

×

• Wiki

• Back

• Git