473,471 Members | 4,650 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

time/timezone setting

256 Contributor
I have an app that runs under Linux (centos and LFS flavors) and I'm having problems with reading the correct time after I change the timezone (by moving the link at /etc/localtime to point to the new timezone file)

Basically, I use a call to time() to get the current time - and when I change the timezone while my app is running the call to time() does not reflect the new timezone unless I kill it and restart. Is there some environment variable or something that I need to update along with the timezone link?

I posted this question under c/c++ programming too:
http://www.thescripts.com/forum/show...03#post2530303
Apr 27 '07 #1
3 3185
michaelb
534 Recognized Expert Contributor
I am not sure if this would solve your problem, but check whether TZ is defined in your environment:
Expand|Select|Wrap|Line Numbers
  1. mingus% echo $TZ
  2. US/Eastern
  3. mingus% 
  4.  
Apr 27 '07 #2
michaelb
534 Recognized Expert Contributor
I probably missed the point here - changes to environment may not affect the running process, you have to restart it.
Apr 27 '07 #3
mac11
256 Contributor
no no - setting TZ helped :)

If I set TZ when I change the timezone everybody is happy
Apr 30 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: CSN | last post by:
Is it possible to update the timezone part of timestamp fields in a single query? I have a bunch of values that are -06 I need changed to -07. BTW, better to use 'timestamp without time zone' or...
5
by: ECVerify.com | last post by:
I am trying to convert a computers local time to Pacific time, I can get it back to UTC pretty easy but I actually want to convert whatever the local time is on the computer I want to calculate...
4
by: Anony Mous | last post by:
Hi, Is there a function that would allow me to set the local time while the server is running? I can't seem to find anything on this... Thanks, Peter ---------------------------(end of...
10
by: David Garamond | last post by:
The Postgres manual says: The AT TIME ZONE construct allows conversions of time stamps to different time zones. I'd guess most people would think what's meant here is something like "unit...
8
by: Nathan Sokalski | last post by:
I use a webhosting service that is something like halfway around the world from me and most of the people that will be viewing my site (and I am assuming their server is too). This obviously has...
2
by: Ken Varn | last post by:
I have a managed C++ method that I call from ASP.NET to set the time zone on the local box. I call SetTimeZoneInformation, which does not return an error, but the time zone remains unchanged. I...
5
by: Sehboo | last post by:
We have a c# application (with about 100 forms, and 300+ tables on sql server). We have several customers who use that application but everybody gets the copy of the database. Structure of the...
3
by: bill | last post by:
I found out that I can only set an offset in my session timezone in my ISP's MySQL server, not a timezone. So I am left with the task of setting the offset, which will vary, depending on whether...
7
by: Correia | last post by:
I have a webserver that is in another country and have a different time zone. How can i fix this and use the scripts with the correct time zone? Thanks
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.