Thread: convert integer unix timestamp to time

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    351

    convert integer unix timestamp to time

    does anyone know of an easy way to create a time_t variable from a timestamp integer.

    or more generally, convert an int containing a timestamp to a string containing a readable date.

    i know how to do this for the current time.

    TIA, rotis23

  2. #2
    Registered User
    Join Date
    Aug 2002
    Posts
    351
    i have a timestamp stored as an integer;
    Code:
    long my_timestamp = 1037732323; //for example

  3. #3
    Registered User
    Join Date
    Aug 2002
    Posts
    351
    thanks, thats what i wanted to know!

    i get the timestamp from a mysql database as an element in a mysql_row which is effectively a char**. i then convert it into numerical form to do time difference calculations.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Link List math
    By t014y in forum C Programming
    Replies: 17
    Last Post: 02-20-2009, 06:55 PM
  2. Assignment HELP!!
    By cprogrammer22 in forum C Programming
    Replies: 35
    Last Post: 01-24-2009, 02:24 PM
  3. Looking for constructive criticism
    By wd_kendrick in forum C Programming
    Replies: 16
    Last Post: 05-28-2008, 09:42 AM
  4. No Match For Operator+ ???????
    By Paul22000 in forum C++ Programming
    Replies: 24
    Last Post: 05-14-2008, 10:53 AM
  5. convert from integer to string
    By peter_hii in forum C++ Programming
    Replies: 2
    Last Post: 04-06-2006, 09:28 AM