473,800 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ 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 3201
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
4649
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 'timestamp with time zone'? __________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now
5
5799
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 what it would currently be in Pacific time. Taking in account Daylight Savings Time Thanks, Ed,
4
4801
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 broadcast)---------------------------
10
15476
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 conversion", and that the timestamp value stays the same (much like 2 feet becomes 24 inches when it's being "converted"). But: # SELECT NOW() = NOW() AT TIME ZONE 'UTC';
8
1242
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 very little effect on what I can do, but there is one thing that I would like to know how to do (if it can be done). When I do something that involves getting the current date or time, my application gets it from the server it is running on, which...
2
3704
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 have checked the web for any information on this, but have not found any articles that relate to this specific problem. Can anyone tell me what is wrong here? Here is a sample snippet of the method: Note that TimeZoneInfo is my own managed...
5
2392
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 database is same, but with different data. All the databases reside on the same server/same instance. We need to make that app time-zone aware. Is there a way in SQL Server 2000 database (or web.config file) to change the time zone?
3
1819
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 or not DST is in effect. Is there a way of discovering, from a PHP script is we are in DST or standard time ? bill
7
2736
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
9690
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10505
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10253
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10033
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.