It is currently April 24th, 2024, 1:22 am

Day of week name off by a day

Get help with creating, editing & fixing problems with skins
__n
Posts: 2
Joined: May 4th, 2017, 4:37 pm

Day of week name off by a day

Post by __n »

Hi there, first time posting so tell me if I got it in the wrong section or anything.

I've got a timestamp variable that's formatted YYYY-MM-DDT00:00:00+00:00 (The last bit is THH:MM:SS+OFFSET but it's always zeroed out). I send this to a measure which formats the date and sends it to the string meter like so:

inc file:

Code: Select all

Task1Due=2017-05-05T00:00:00+00:00
skin.ini:

Code: Select all

[Task1DueStamp]
Measure=Time
TimeStamp=#Task1Due#
TimeStampFormat=%y-%m-%d
Format=%a %e %b

[Task1Due]
Meter=String
Text=[Task1DueStamp]
StringAlign=Center
ClipString=2
ClipStringW=30
FontFace=Tahoma
FontSize=11
X=25
Y=-58R
AntiAlias=1
Group=Task1
But the name of the weekday seems to be forward by a day:
Image

I don't see why this would be the case, and if there isn't a solution I can just parse the date in lua.
Thanks in advance.
Last edited by __n on May 4th, 2017, 6:20 pm, edited 1 time in total.
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Day of week name off by a day

Post by ikarus1969 »

In the TimestampFormat you have to use an uppercase letter "Y" (year with century) instead of the lower-case "y" (year without century) because your variable contains the century ;-)
__n
Posts: 2
Joined: May 4th, 2017, 4:37 pm

Re: Day of week name off by a day

Post by __n »

Hah, such a small mistake. Thanks, it works perfectly now.
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Day of week name off by a day

Post by ikarus1969 »

glad to help