![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compare date from db2 table to yesterday's Unix system date | sasaliasim | Shell Programming and Scripting | 9 | 12-01-2008 11:37 PM |
| File timestamp issue on HP servers | siddaonline | UNIX for Advanced & Expert Users | 5 | 07-04-2007 11:09 AM |
| getting date from timestamp | pavan_test | UNIX for Dummies Questions & Answers | 2 | 09-28-2006 12:01 PM |
| Command DATE in UNIX System | ZINGARO | UNIX for Dummies Questions & Answers | 3 | 07-20-2006 05:07 PM |
| date override | gerry shacter | AIX | 1 | 01-09-2006 01:42 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
override the system date-timestamp on the Unix servers
I am looking for a tool that allows us to override the system date-timestamp on the Unix servers so that we can perform regression tests using the same set of scripts and data. CDS is an example of a system where the logic is very date/time dependent. It would make regression testing much easier and more reliable if we could always start the tests at the same date/time. I recall back in the Y2K days there was a tool that allowed us to do that on the Unisys mainframe, but not sure about Unix.
|
|
||||
|
Yes, a great suggestion but that requires screwing with the servers and rebooting before each test. I don't want to do that. I want the server to maintain its time so files created are time stamped appropriately. I want the utility to fake out the system so that when the code calls for the current date/time it gets what I want it to be. I want to be able to run multiple iterations of tests using current and past dates. Do you have any other suggestions? Thanks again for the prompt response!
![]() |
|
||||
|
pthread_cond_timedwait() takes an absolute time, if you step back six months any threaded code waiting on one of these will wait six months.
Oh, and don't use NFS across time discontinuities. |
|
||||
|
The system time is kept in the kernel, and maintained by it. The only other solution other than what Porter and Perderabo mentioned is to have a small dedicated time-warped box that runs without ntpd. Or play with TZ.
If whatever you're using DOES NOT use UTC, but calls libc localtime, then you can create a custom timezone. POSIX compliant systems are required to have ways to set timezones with almost any offset from UTC. Start all of your regressions in the special timezone. How you set up your timezone is totally system dependent (POSIX allows for three methods), but you should be able to accomplish this with TZ variable alone. example my ZZT timezone: Code:
$> export TZ=ZZT6:30:22 $> date Thu Sep 27 07:25:51 ZZT 2007 $> export TZ=CST6CDT $> date Thu Sep 27 08:56:34 CDT 2007 |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|