GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Will it impact by DST changes
Operating System - HP-UX
1849612
Members
6397
Online
104044
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2007 02:10 AM
02-08-2007 02:10 AM
Will it impact by DST changes
We are using the following functions in the Time.h file
we are getting the time using make_time function and then adding the duration to it.
This the code we have:
Time current_time = make_time( "now" );
Duration thirty_days(30);
Time exp_date = current_time + thirty_days;
set_Expire_Date( exp_date.make_string("%m/%d/%Y") );
These are the definitions found in Time.h file
Time make_time(const char* p);
const Time& Time::operator+=(const Duration& right){
t += (time_t)seconds(right);
return *this;
}
So because of DST will it impact the above code??
we are getting the time using make_time function and then adding the duration to it.
This the code we have:
Time current_time = make_time( "now" );
Duration thirty_days(30);
Time exp_date = current_time + thirty_days;
set_Expire_Date( exp_date.make_string("%m/%d/%Y") );
These are the definitions found in Time.h file
Time make_time(const char* p);
const Time& Time::operator+=(const Duration& right){
t += (time_t)seconds(right);
return *this;
}
So because of DST will it impact the above code??
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2007 02:49 AM
02-08-2007 02:49 AM
Re: Will it impact by DST changes
Shalom,
I don't recommend running any time based software or daemons through this upgrade process.
I reccomment installing all requires software patches and java and then booting your system.
Then your program should operate correctly.
SEP
I don't recommend running any time based software or daemons through this upgrade process.
I reccomment installing all requires software patches and java and then booting your system.
Then your program should operate correctly.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2007 02:04 PM
02-08-2007 02:04 PM
Re: Will it impact by DST changes
I can't really see an issue. If you only want the day, and DST start and end are deferred to 2 am, then you can never have the wrong date.
But if this is all you are doing, you should immediately abandon Time(3) and use ctime(3):
#include
#include
int main() {
char buf[128];
time_t now = time(NULL);
time_t next_month = now + 30*24*3600; /* seconds in 30 days */
struct tm *p = localtime(&next_month);
int len = strftime(buf, sizeof(buf), "%m/%d/%Y", p);
printf("Next month is %s\n", buf);
return 0;
}
But if this is all you are doing, you should immediately abandon Time(3) and use ctime(3):
#include
#include
int main() {
char buf[128];
time_t now = time(NULL);
time_t next_month = now + 30*24*3600; /* seconds in 30 days */
struct tm *p = localtime(&next_month);
int len = strftime(buf, sizeof(buf), "%m/%d/%Y", p);
printf("Next month is %s\n", buf);
return 0;
}
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP