It is currently October 19th, 2020, 9:10 pm

[SOLVED] Convert Windows timestamp to Rainmeter time

Help with creating, editing & fixing problems with skins
nmdelrio
Posts: 54
Joined: June 28th, 2015, 12:51 pm
Location: Paranaque City, Philippines

[SOLVED] Convert Windows timestamp to Rainmeter time

Post by nmdelrio »

I am trying to add a day (or days) to the current time. I am doing this by adding seconds to the current time' s timestamp. I get a result in timestamp. How do I convert the timestamp back to time (i.e., date-day) ? I am not sure if I have the correct approach.

Is there a better or correct way to do this?

Code: Select all

[DateDayToday]
Measure=TIME
Format=%h %d %a

[DateDayTomorrowSeconds]
Measure=CALC
Formula=[DateDayToday:Timestamp] + (24 * 60 * 60)
DynamicVariables=1


[DateDayAfterTomorrowSeconds]
Measure=CALC
Formula=[DateDayToday:Timestamp] + (48 * 60 * 60)
DynamicVariables=1
Last edited by nmdelrio on October 17th, 2020, 11:08 am, edited 2 times in total.
User avatar
balala
Rainmeter Sage
Posts: 11575
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Pls Help] Convert Windows timestamp to Rainmeter time

Post by balala »

nmdelrio wrote: October 16th, 2020, 7:20 pm How do I convert the timestamp back to time (i.e., date-day) ?
Simply converting the [DateDayTomorrowSeconds] measure to a Time measure and adding the appropriate Format option:

Code: Select all

[DateDayTomorrowSeconds]
Measure=Time
TimeStamp=([DateDayToday:Timestamp] + 24 * 60 * 60)
DynamicVariables=1
Format=%h %d %a
nmdelrio
Posts: 54
Joined: June 28th, 2015, 12:51 pm
Location: Paranaque City, Philippines

Re: [SOLVED] Convert Windows timestamp to Rainmeter time

Post by nmdelrio »

Thanks balala, you saved me once again.
User avatar
balala
Rainmeter Sage
Posts: 11575
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [SOLVED] Convert Windows timestamp to Rainmeter time

Post by balala »

nmdelrio wrote: October 16th, 2020, 8:30 pm Thanks balala, you saved me once again.
Glad to help. :thumbup: