Current Position:Home > Convert Data time stamp to Local Time

Convert Data time stamp to Local Time

Update:10-11Source: network consolidation
Advertisement
Hello,
I want to convert this input to local time EST.
Input:12/8/2006 10:23:00.000000000 PM -06:00
o/p: EST.Local Time

The Best Answer

Advertisement
Is the input a string? A timestamp? If so, which flavor of timestamp? Something else?
Normally, you'd want to use a TIMESTAMP WITH LOCAL TIME ZONE data type for this sort of requirement, since it automatically converts data to the client's time zone. Assuming the input is a string and that the client's time zone is set to EST
  1  select cast(to_timestamp_tz( '12/8/2006 10:23:00.000000000 -06:00',
  2                               'MM/DD/YYYY HH24:MI:SS.FF TZH:TZM' )
  3                AS TIMESTAMP WITH LOCAL TIME ZONE)
  4*   from dual
SCOTT @ nx102 JCAVE9420> /
CAST(TO_TIMESTAMP_TZ('12/8/200610:23:00.000000000-06:00','MM/DD/YYYYHH24:MI
08-DEC-06 11.23.00.000000 AM
Elapsed: 00:00:00.01
SCOTT @ nx102 JCAVE9420> Justin
  • Convert Data time stamp to Local Time Update:10-11

    Hello, I want to convert this input to local time EST. Input:12/8/2006 10:23:00.000000000 PM -06:00 o/p: EST.Local TimeIs the input a string? A timestamp? If so, which flavor of timestamp? Something else? Normally, you'd want to use a TIMESTAMP WITH

  • Converting UTC time stamp to local time (CET) Update:10-11

    Is there a smooth way to convert a time stamp from UTC time into the local time (e.g. CET)? CONVERT TIME STAMP.... Just converts the timestamp from local time zone to UTC, is there another comand to perform the opposite conversion? TIA! /ArminHi Armi

  • HELP - How to Convert Date in GMT to Local time in Applet Update:10-11

    Hi All Is there a way to convert a date from GMT format into a local time say IST in my Java applet, this GMT date is coming from a postgresql database. Thanks in advance SwarajTry this with your customization: java.text.SimpleDateFormat format0 = ne

  • Converting UNIX time stamp to local time using T- SQL Update:10-11

    Hi All, I am getting DateTime in UTC time (UTC time (Coordinated Universal Time or Greenwich Mean Time))  using (datediff(ss, '1/1/1970', current_timestamp)) . I want to Convert this in my Local DateTime (CST DateTime). How to achieve this in simple

  • Saving result from sp_executesql into a variable and using dynamic column name - getting error "Error converting data type varchar to numeric" Update:10-11

    Im getting an error when running a procedure that includes this code. I need to select from a dynamic column name and save the result in a variable, but seem to be having trouble with the values being fed to sp_executesql DECLARE @retval AS DECIMAL(1

  • Error "Conversion failed when converting date and/or time from character string" to execute one query in sql 2008 r2, run ok in 2005. Update:10-11

    I have  a table-valued function that run in sql 2005 and when try to execute in sql 2008 r2, return the next "Conversion failed when converting date and/or time from character string". USE [Runtime] GO /****** Object:  UserDefinedFunction [dbo].

  • Converting Date.toString() back to a Date object for compare Update:10-11

    I know this is beating a dead horse to death but I have wasted a whole day trying to get this to work. Here is the problem. I need to convert a Date().toString (format returned: Dec 19, 2006 3:39:58 PM EST) back to a Date object. What I am doing is w

  • Convert date/time to Unix epoch Update:10-11

    I have thousands of date time stamps I would like to convert to Unix epoch ten-digit strings. That is, take some thing like: Dec 9, 2005 10:24 AM and convert to 1234567890 (only in the correct unix epoch time) What formula can I use? I've found that

  • Add Date/Time Stamp to Timecode Effect Update:10-11

    The Timecode effect of CS5 Premiere Pro is a very useful feature. However, it is missing a Date/Time Stamp. I would encourage everyone to submit a feature request for this. I have enclosed one I submitted. You can cut and paste it into the Feature Re

  • Function module to convert to time stamp format Update:10-11

    Hi friends, can you tell me any function module to convert date and time to time stamp format? kind regards.Just use  CONVERT DATE d TIME t [DAYLIGHT SAVING TIME dst] INTO TIME STAMP tst TIME ZONE tz. look at this example DATA: tstamp type timestamp,