It is currently March 29th, 2024, 5:13 am

[SOLVED] Convert Windows timestamp to Rainmeter time

Get help with creating, editing & fixing problems with skins
User avatar
nmdelrio
Posts: 74
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: 16110
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
User avatar
nmdelrio
Posts: 74
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: 16110
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: