Hi all,
I am printing yesterday date in solaris using command:
TZ=GMT+24 date +%b_%d_%Y
but at 01:00 AM on jan 11, it is printing:
Anyone please explain.
Hi all,
I am printing yesterday date in solaris using command:
TZ=GMT+24 date +%b_%d_%Y
but at 01:00 AM on jan 11, it is printing:
Anyone please explain.
You're going in the wrong direction. Here in California (in the United States of America) where the nominal TZ setting is PST8PDT
, you would need PST-16PDT
to get tomorrow's date at the same time of day. You could use:
TZ=GMT-24 date
to get tomorrow's date and time.
Note however that the standards don't require that systems accept hour offsets with absolute value larger than 24, so subtracting 24 from a TZ offset in Europe to get tomorrow's date might not work.