Solaris Time Problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Solaris Time Problem
# 1  
Old 01-11-2013
Solaris Time Problem

Hi all,

I am printing yesterday date in solaris using command:
Code:
TZ=GMT+24 date +%b_%d_%Y

but at 01:00 AM on jan 11, it is printing:
Quote:
Jan_09_2013 instead of
Jan_10_2013
Anyone please explain.
# 2  
Old 01-11-2013
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:
Code:
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Epoch time in Solaris

One way of getting epoch time in solaris is truss date 2>&1 | awk '/^time/{print $3}' Is there any other simple command that can be run from Korn Shell to display epoch time in solaris 5.10? (3 Replies)
Discussion started by: indianya
3 Replies

2. Solaris

modifying date and time and time zone on solaris 5.10 with (redundant server) veritas

I have a cluster of two Solaris server (veritas cluster). one working and the other is standby I am going to change the date on them , and am looking for a secure solution as it is giving an important service. my opinion is that the active one doesn't need to be restarted (if I don't change the... (1 Reply)
Discussion started by: barry1946
1 Replies

3. UNIX for Dummies Questions & Answers

Having a problem with the time sync from Solaris 10 to VirtualBox

I have a VirtualBox w2008r2 Domain Controller running on a Solaris 10 server. I have the time on the Virtual machine set to Default time sync (bios clock) and the Solaris server set to sync to 0 8,20 * * * /usr/sbin/ntpdate tick.usno.navy.mil tock.usno.navy.mil >> /tmp/ntp.log My problem is... (2 Replies)
Discussion started by: SIFT3R
2 Replies

4. Solaris

Time setting on Solaris 10

Hi all, Any idea please how to: -Change Time format from 24h format to 12h format (AM and PM) -Turn off DST: Daylight Save Time on a Solaris10 server Thanks in advance (1 Reply)
Discussion started by: rafikrafik09
1 Replies

5. Solaris

Time out in Solaris

Hi, When i telnet, ssh and other method to connect to a Solaris server, after few minute if i did not do any action on the server, it will automatically disconnect. any idea on this? (10 Replies)
Discussion started by: SmartAntz
10 Replies

6. Shell Programming and Scripting

Ksh Solaris Time calculation problem..Please help

I've gone through bunch of threads on time calculations but none of them helps on my problem I've to get the time difference in HHMM format from following inputs Input 1 : 01/08/2010 01:30 01/08/2010 03:20 Input 2 : 01/06/2010 22:00 01/07/2010 16:00 First input is easy but... (8 Replies)
Discussion started by: prash184u
8 Replies

7. Solaris

time difference on solaris 10

Hi, in the log file, it shows like this <Sep 4, 2009 1:31:06 PM PDT> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode> and i filter this log file to capture the time stamp -1:31:06 PM PDT. Can any one please provide the detail on how to find the difference between... (1 Reply)
Discussion started by: alnhk
1 Replies

8. Shell Programming and Scripting

how to convert date time to epoch time in solaris

Hi, Is there any easy way to convert date time(stored in shell variable ) to epoch time in solaris box? As +%s is working on linux but not on solaris, also -d option is not working. Any suggestion please? (6 Replies)
Discussion started by: anshuman0507
6 Replies

9. UNIX for Dummies Questions & Answers

ftp time on Solaris 8

Hello all, Does anyone know how to set the timeout limit on Solaris ftp machine. Thanks all (2 Replies)
Discussion started by: larry
2 Replies

10. UNIX for Dummies Questions & Answers

default time in Solaris 8 for time-wait

Ok, heres the situation. We use Solaris 8 and sometimes users who are logged into our system restart their pc's without shutting down the application that attached to our unix backend. I netstat and I get time-waits for the users. My question is how long before the time-wait ends and the user... (1 Reply)
Discussion started by: eloquent99
1 Replies
Login or Register to Ask a Question