#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2005
    Posts
    18
    Rep Power
    0

    How can I convert IST time to EST time


    Please let me know how to convert IST (Indian Standard Time) to EST,
    Its urgent, plz help
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Suffolk, England
    Posts
    434
    Rep Power
    14
    Originally Posted by kushasthana
    Please let me know how to convert IST (Indian Standard Time) to EST,
    Its urgent, plz help
    Use mktime
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Posts
    16
    Rep Power
    0
    PHP Code:
    $YourOwnFormat "F j, Y, g:i a";

    echo 
    date($YourOwnFormat,time()-(10.5*60*60)); 
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2005
    Posts
    18
    Rep Power
    0

    please xplain


    I have a date in format like "YYYY-mm-dd H:m:s", its in IST

    Now ehn i want to store the time in database then i want to store it in EST time.

    Please let me know the procedure, i 'ld not get ur last answer

    Kush



    Originally Posted by thinktank
    PHP Code:
    $YourOwnFormat "F j, Y, g:i a";

    echo 
    date($YourOwnFormat,time()-(10.5*60*60)); 
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Suffolk, England
    Posts
    434
    Rep Power
    14
    So, you just want the date format differently?

    $YourOwnFormat = "Y-m-d, H:i:s";

    That would do it to how it is stored in your database
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2005
    Posts
    18
    Rep Power
    0

    Question IST to EST help


    thx for help ... but I m not able to get it

    my date is like this in ist time zone

    $new_dt_ist=date("Y-m-d H:i:s",$ts);

    please give me the procedure and code to convert it in EST time zone

    i 'll be vary thankful

    regards,
    Kush Asthana




    Originally Posted by MacMyDay
    Use mktime
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Posts
    16
    Rep Power
    0
    Ok, just plug this function somewhere..
    PHP Code:
    function EST_from_IST($required_format,$IST_val="now")
    {
       return 
    date($required_format,strtotime($IST_val." -10 Hours -30 minutes"));

    You can then call the function in any of the following way..

    PHP Code:
    echo EST_from_IST("Y-m-d H:i:s"); //returns the current time
    echo EST_from_IST("Y-m-d H:i:s","2005-02-18 14:30");
    echo 
    EST_from_IST("Y-m-d H:i:s","February 18th, 2005 11:30 AM");
    echo 
    EST_from_IST("Y-m-d H:i:s","Yesterday 11:30 AM");
    echo 
    EST_from_IST("Y-m-d H:i:s","Tomorrow 5 PM"); 
    Note: The time returned is EST. To get EDT(Eastern Daylight Time), change the " -10 Hours 30 minutes" to " -9 Hours 30 minutes" in the above function!

IMN logo majestic logo threadwatch logo seochat tools logo