Resetting date


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Resetting date
# 1  
Old 07-01-2008
Resetting date

Hi there,
Is there a way i can reset the date on my unix terminal to yesterday's date?

date
Tue Jul 1 14:18:21 GMT 2008

Please let me know.
JAK
# 2  
Old 07-01-2008
Modifying TZ may work:

Code:
$ date
Tue Jul  1 14:24:33 GMT 2008
$ TZ=GMT+24
$ date
Mon Jun 30 14:24:47 GMT 2008

# 3  
Old 07-01-2008
Thanks radoulov, how about setting to a specific date not just yesterday?

Thanks again,
JAK
# 4  
Old 07-01-2008
You should read man date
# 5  
Old 07-01-2008
Quote:
[...]
how about setting to a specific date not just yesterday?
I'm not sure if you want to change the date system wide or only for the current session.
The latter seams quite difficult ...
# 6  
Old 07-01-2008
I wanted to set for current session but for now i got by just resetting to yesterday ..

Thanks for the response and kind help
JAK
# 7  
Old 07-01-2008
unix time is kept by the kernel as 'epoch' seconds elapsed since Jan 1, 1970. All of the date functions and commands reference epoch seconds. You cannot set epoch seconds for one process. You can only trick some commands into thinking you are in a weird timezone, so that you can "go" backwards/forwards as much as 24 hours. No more because the length of a day is 24 hours. And you are not changing epoch seconds, just how they are interpreted.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Restarting/Resetting a USB Port?

Hello All, So I have been running into an issue with a USB Modem where if someone ends their dialin connection abruptly from the other side the modem gets stuck and I found that the only way to fix it is to either unplug the USB Modem and plug it back in, or just reboot. I'd rather not reboot... (5 Replies)
Discussion started by: mrm5102
5 Replies

2. AIX

Resetting the NVRAM

Does anybody know how to reset the NVRAM on a System p 520 (power 5)? (7 Replies)
Discussion started by: livehho
7 Replies

3. Solaris

Resetting ALOM

Hi gurus, I have a sun netra 240 server. I want to get to the ALOM but it always ask for login and password. Can anyone tell me how I can reset the ALOM it to default so I can be able to configure it? Thanks lots. (2 Replies)
Discussion started by: cjashu
2 Replies

4. Solaris

rebooting resetting loop

while installing unix solaris I found that one of the CD's is corupted so I bring another copy of solaris CD's and type reboot instead of 'reboot cdrom' then the server goes in infinite loop of rebooting resetting??I tried to use ctrl+break but didnt work....how can I break this loop....plz help?? (4 Replies)
Discussion started by: mm00123
4 Replies

5. Shell Programming and Scripting

Resetting the Positional parameters values

Hi, Can any one provide the Unix command to reset the positional parameters? Please see the below example where i have to pass 2 parameters to Shell1.sh. Step1) . ./Shell1.sh 2 3 successfully executed, Then i executed(next step only) the same shell script again,this time no... (4 Replies)
Discussion started by: nmk
4 Replies

6. Shell Programming and Scripting

resetting IFS variable

Hi, I have modified the IFS variable in the K shell program and with in the program i want to reset to the default one. How do i reset the same. e.g in the begining of the program IFS is default in the middle i changed it to IFS="|" and again i want the default value for the IFS. ... (2 Replies)
Discussion started by: vijaykrc
2 Replies

7. Solaris

Resetting user's passwords

Hi all, I'm developing a script to handle the various actions involved with user admin as root: Reset password create a new users change a users email address, etc We're in the process of changing over from "telnet" to "SSH" to establish terminal sessions on our Solaris 9/10 servers. ... (2 Replies)
Discussion started by: dewets
2 Replies

8. Programming

resetting counter using bitwise XOR

Hi ! How to reset a variable to 0 after a reset value, say 10 using bitwise XOR. For example, int cnt=0; if(cnt<10) cnt++; else cnt = 0; How can we achieve this by using XOR only. thanks, (1 Reply)
Discussion started by: mrgubbala
1 Replies

9. UNIX for Dummies Questions & Answers

Resetting WTMP?

When I type last oracle I get dates from Nov 28, 2000 all the way back to the beginning of time it seems. The 11-28-2000 entry states that Oracle is still logged in, but if you type a who, it shows only 1 entry - the currently logged in user (Me as oracle), but I logged in only minutes ago - and... (4 Replies)
Discussion started by: cuppjr
4 Replies
Login or Register to Ask a Question