![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How can we get time from a unix file? | atif_etl | UNIX for Advanced & Expert Users | 4 | 02-28-2008 01:27 PM |
| How Can I Do Time Validation in UNIX | mosammey | UNIX for Dummies Questions & Answers | 4 | 11-26-2007 12:02 PM |
| Linux Going Big Time and Prime Time Against Windows, UNIX (WSJ) (Addict 3D) | iBot | UNIX and Linux RSS News | 0 | 06-21-2007 05:10 PM |
| How To Provide Time Sync Using Nts-150 Time Server On Unix Network? | pesty | UNIX for Advanced & Expert Users | 2 | 03-22-2007 02:20 AM |
| Help me!First time use UNIX. | zhshqzyc | UNIX for Dummies Questions & Answers | 1 | 02-07-2006 11:00 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Can somebody write a solution how to deal with negative unixdates in C/C++?
e.g. I should convert -222832800 into 12-10-1962. I've read some texts about unixdate. They say that negative values are not officially supported, some functions use -1 to report a conversion error. How can I use this stuff? I've to store birthdays in UNIX - time format and itcan be less than 1970... |
|
||||
|
Negative UNIX time
Angler,
I'm not sure if anyone has helped you with this, but in case not - here goes. UNIX times are stored as unsigned integers. If you're getting a negative value, it's because the number is large and is using that "most significant bit" - hence it appears to be signed, but really is not. You can count on legal values being positive at all times. If you appear to be getting a negative value, then try re-casting as an unsigned integer when you obtain the value from the database. Unfortunately if the value was stored in the database as negative, the original error was on the part of whoever set up the schema. S. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|