Converting cst time stamp to gmt time

Hi,
i need a udf for the following requirement
"Source will be                                                                                Format: 'CCYY-MM-DD-HH.MN.SS.TTTTTTu2019
Example:  u20182011-04-18-14.32.13.494000u2019
Destination will be    
Fomat: 'YYYY-MM-DDThh:mm:ssZ'
Example: '2002-05-30T09:30:10Z'
Note: The source date will be in the CST timezone and must be converted to the GMT timezone"
thanks in advance

HI praneethrao13 ,
you try to use below code and before change the code as ur requirement.
example for UTS to CST:
====
imports: java.util.Date;java.text.SimpleDateFormat;java.text.DateFormat;
====
Date date = new Date();
DateFormat utcFormat = new SimpleDateFormat("yyyy-MM-dd-HH.mm.ss.SSSS");
DateFormat cstFormat = new SimpleDateFormat("yyyy-MM-dd-HH.mm.ss.SSSS");
TimeZone utcTime = TimeZone.getTimeZone("UTC");
TimeZone cstTime = TimeZone.getTimeZone("CST");
utcFormat.setTimeZone(cstTime);
cstFormat.setTimeZone(utcTime);
return utcFormat.format(date);
thanks,

Similar Messages

  • Convert date time local Timezone  to GMT

    I need to get GMT time...
    How to convert local time to GMT ?
         public static long getGMTNow()
             Calendar local = new GregorianCalendar();
             local.set(Calendar.HOUR_OF_DAY, 0);              
             local.set(Calendar.MINUTE, 0);
             local.set(Calendar.SECOND, 0);
             System.out.println(local.getTime());
             System.out.println(local.getTimeInMillis());
             Calendar gmtC = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
             gmtC.setTimeInMillis(local.getTimeInMillis());
             System.out.println(gmtC.getTime());
             return gmtC.getTimeInMillis();
         }Result :
    Thu Feb 12 00:00:00 EST 2009
    1234414800034
    Thu Feb 12 00:00:00 EST 2009
    1234414800034

    Calendar gpsTime = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
             gpsTime.set(Calendar.HOUR_OF_DAY, 10);              
             gpsTime.set(Calendar.MINUTE, 0);
             gpsTime.set(Calendar.SECOND, 0);
             System.out.println("gpsTime: "+gpsTime.getTime());
             Calendar realtime= new GregorianCalendar();
             realtime.set(Calendar.HOUR_OF_DAY, 5);              
             realtime.set(Calendar.MINUTE, 0);
             realtime.set(Calendar.SECOND, 0);
             System.out.println("realtime: "+realtime.getTime());
             System.out.println("COMPARETO : "+ realtime.compareTo(gpsTime));
             long timediff = realtime.getTimeInMillis() - gpsTime.getTimeInMillis();
             System.out.println(timediff/1000 + " sec");RESULT :
    gpsTime: Mon Feb 16 05:00:00 EST 2009
    realtime: Mon Feb 16 05:00:00 EST 2009
    COMPARETO : 1
    0 secOk, I done my homework. getTime() will allways return local time so I need to set the GPS time to a GMT Calendar to get the right result.
    Funny thing, look at the compareTo result....

  • Converting UTC time stamp to local time (CET)

    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!
    /Armin

    Hi Armin
    The statement does not only convert from local time zone to UTC you can specifiy any timezone:
    CONVERT TIME STAMP time_stamp TIME ZONE tz
            INTO [DATE dat] [TIME tim]
            [DAYLIGHT SAVING TIME dst].
    The following statement can also be used to convert from date time to timestamp.
    CONVERT DATE dat [TIME tim [DAYLIGHT SAVING TIME dst]]
            INTO TIME STAMP time_stamp TIME ZONE tz.
    Regards
    Faaiez

  • Convert local time to GMT

    Hi everybody,
    i receive a lot of operation date from many worldwide ports like these:
    SINGAPORE 23/FEB/2011 13:50 (local time)
    GHENT(NL) 23/FEB/2011 12:00 (local time)
    i'm required to convert these information to GMT date.
    I've found NEW_TIME function but it seems inadequate:
    1) the function does not consider daylight saving periods; i mean when tmz1 switches from daylight savings on to daylight savings off and tmz2 does not, the function does not change the time difference (at least it's the result of my test unless all valid timezones switch at the same time)
    2) valid parameters are 18 therefore they don't cover all the possible combinations
    Could you please help to cope the matter ?
    Many thanks in advance
    Stefano

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by David Hsiung ([email protected]):
    How can i convert local time to GMT time in
    the Form?<HR></BLOCKQUOTE>
    David,
    there is a date function caled NEW_TIME that should work. For ex:
    select to_char(new_time (sysdate, 'EST','GMT'), 'HH:MI:SS')
    from dual;
    05:31:00

  • Time convertion b/w BST to GMT

    Hi Guys,
    Is there any Oracle function to convert British time Zone(BST) to Green wich meen time Zone(GMT).
    if it is there would you please help me by Explaining that..
    I need to covert Trade execution time from BST to GMT wich should Need to be in GMT.
    Thankx In Advance...
    thankx,
    Lakshmi.

    Hi and welcome to the forum!
    Your question has been asked before, see f.i.:
    Re: Converting Date to timestamp with time zone
    (Do some more searches on this forum to find more examples)
    Read all about TIMESTAMP, CAST, FROM_TZ @ http://tahiti.oracle.com (the Oracle Documentation).
    If that doesn't get you going, then please post your DB-version and your efforts sofar.

  • VI to convert Unix time to standard time?

    hi,
    I am in need of a VI to convert Unix time to Standard time?
    eg: Unix time: 1268845177 in seconds
    Standard time: GMT: Wed, 17 Mar 2010 16:59:37 GMT
                            Your timezone(U.S):
    Wednesday, March 17, 2010 10:59:37 AM
    I have the calculation but not full formula.
    Unix time is in seconds from Jan 1,1970, 00:00:00 UTC, starting at 0 counting forward.
    When 1268845177/86400 = 14685 days.
    86400 = 60*60*24 seconds
    But how to convert the 14685 days and relate to the current date, how it should be done?
    Either the formula or a VI to convert Unix time to standard time will be a help.
    Regards,
    Arvinth

    Timestamps and the PC clock vs. time on the net are different and I'd say somewhat unrelated concepts.
    You are worried about accuracy of the current time.  Timestamps have nothing to do with current time, but are a way of identifying and particular moment in time.
    Yes, the PC clock gets its time from the net assuming the time server settings are all set properly.  Even the correction of the current PC time may not happen exactly when the leap second gets inserted.  It may be some time before the PC resynchronizes with the net time.  The PC doesn't know if the existence of when a leap second will occur.  And neither does the LabVIEW timestamp.
    Here is an example.  According to http://en.wikipedia.org/wiki/Leap_second, a leap second will occur at the end of June 30 of this year UTC.  Since my clock is eastern daylight time at that date, I put together an example for 8pm on June 30  (UTC +4).  You'll see that the 3 values (a second before, the exact time, and a second after) show they are all 1 second apart.  There is no extra second accounted for.  So in real life the time a second after  vs. a second before are actually 3 seconds apart, but LabVIEW only show 2 seconds.  Feel free to play with the attached snippet for different timezones and daylight savings time and all of that.
    I don't think you really have as big of a problem as you are trying to investigate here.  If your timing needs are that critical where you need accuracy of the current time to better than a second, then you shouldn't be looking at LabVIEW timestamps, PC time clock, or internet time at all, but look at a high accuracy timing source perhaps based on a GPS clock.
    Unless you have a particular test planned to run over the expected point of time where a leap second is inserted, then you shouldn't have to worry.  Even if you do have a test run over the leap second, you probably don't need to worry either.  If the test is based on a waveform datatype, then you have a T0 timestamp, and a dT that will keep track of all the individual data points accurately.
    Attachments:
    Example_VI.png ‏20 KB

  • How to convert epoch time to datetime in sql*loader Oracle

    Hello,
    I wan't to question how to convert epoch time to datetime in sql*loader Oracle. I try this script for convert epoch time to datetime in sql*loader, but error:
    Record 1: Rejected - Error on table TEMP_TEST_LANGY, column DATADATA.
    ORA-01722: invalid number
    Record 2: Rejected - Error on table TEMP_TEST_LANGY, column DATADATA.
    ORA-01722: invalid number
    Record 3: Rejected - Error on table TEMP_TEST_LANGY, column DATADATA.
    ORA-01722: invalid number
    This is my loader:
    LOAD DATA INFILE 'C:\Documents and Settings\Administrator\My Documents\XL_EXTRACT_211\load.csv'
    into table TEMP_TEST_LANGY append
    FIELDS TERMINATED BY ','
    TRAILING NULLCOLS
    DATADATA CHAR "TO_DATE('01-JAN-1970','DD-MON-YYYY')+:datadata/86400"
    This is my csv file:
    79314313.7066667
    79314336.2933333
    79314214.3466667
    This is my table:
    CREATE TABLE TEMP_TEST_LANGY
    DATADATA DATE
    Thanks
    Edited by: xoops on Sep 21, 2011 8:56 AM
    Edited by: xoops on Sep 21, 2011 8:58 AM

    thanks for your answer, but I asked to use sql loader instead of the external table, which so my question is why can not the epochtime converted to datetime, if there is no way to convert a datetime epochtime using sql loader, so I'm required to use the external table. thank you.
    This is my error log:
    Column Name Position Len Term Encl Datatype
    DATADATA FIRST * , CHARACTER
    SQL string for column : "TO_DATE('1-Jan-1970 00:00:00','dd-MM-YYYY hh24:mi:ss') + (:DATADATA/60/60/24)"
    Record 1: Rejected - Error on table TEMP_TEST_LANGY, column DATADATA.
    ORA-01722: invalid number
    Record 2: Rejected - Error on table TEMP_TEST_LANGY, column DATADATA.
    ORA-01722: invalid number
    Record 3: Rejected - Error on table TEMP_TEST_LANGY, column DATADATA.
    ORA-01722: invalid number
    Edited by: xoops on Sep 21, 2011 12:33 PM

  • Can I convert Facebook time Text to Project Siena's Date value ?

    Can I convert Facebook time Text to Project Siena's Date value ?
    I want to show create_time on screen by my Localtime formatted text.
    Facebook time Text = 2014-07-14T11:22+0000
    I want to show = 2014/07/14 18:22
    My Time Zone is +09:00, Osaka/Japan.
    Currently I try it by Text/Replace/Replace/Replace/Left/DateValue/+ , etc.
    And I ask more simple way.
    Regards,
    Yoshihiro Kawabata

    Thank you Andy , and Robin, I can.
    Text(TimeValue(Substitute(ThisItem!created_time,"+0000",".000Z")),"yyyy/mm/dd hh:mm")
    At Facebook Albums's Gallary, I can convert from Facebook created_time to Localtime Text DateTime.
    and I hope more easy way like Excel Power Query's one.
    Regards,
    Yoshihiro Kawabata

  • Can I convert Twitter time Text to Project Siena's Date Value ?

    Can I convert Twitter time Text to Project Siena's Date Value ?
    I want to show localtime of Twitter created_at.
    Twitter time text = ThisItem!created_at , ex: Tue Jul 15 17:19:00 +0000 2014
    I want to show 2014/07/16 02:19 by Japan localtime.
    Regards,
    Yoshihiro Kawabata

    Siena uses JavaScript to parse date/times, via the TimeValue function. A good specification regarding what is acceptable can be found here:
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
    The example above is truly bizarre: I thought I had seen it all. You will need to turn that form into one of those listed on the above site, using string functions to chop it up and reassemble it into a saner form.

  • How convert date/time from xml in xdp(Designer)?

    Hi, i want to convert date/time format from xml in Designer, date/time value in xml is NOT in common format YYYY-MM-DD (if is in a common format i can do this with pattern)
    I have a "DateTime" Field in Xdp can get from Xml date and time:
    In XML <DateTime>DD-MM-YYYY</DateTime> i want to convert in XDP in DateTime Field in "DD-April-YYYY"
    Can i do this?

    You can do this way..
    Bind the date field to your XML tag.
    Set the display pattern for the date field.
    In the initialize event of the date field place the following code.
    Set JavaScript as language.
    var dtStr = this.rawValue;
    var pos1=dtStr.indexOf("-");
    var pos2=dtStr.indexOf("-",pos1+1);
    var strMonth=dtStr.substring(0,pos1);
    var strDay=dtStr.substring(pos1+1,pos2);
    var strYear=dtStr.substring(pos2+1);
    //Assign the formatted value to the Date field.
    this.rawValue = strYear + "-" + strMonth + "-" + strDay;
    Thanks
    Srini

  • FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.

    HI EXPERTS,
         FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.
    PLS DO HELP.....

    Hiii gita
    we have another FM SPELL_AMOUNT
    regards
    Jaipal

  • Need function module to convert system time to local time

    Hi Experts,
    Need function module to convert system time to local time.
    i.e country specific that to in HH:MM format.
    Thanks in advance.

    Dear Prince,
    Kindly check the following link which contains the list of function modules for date and time conversion.
    [http://www.sap-img.com/abap/date-month-pop-related-function-modules.htm]
    Regards

  • Help Converting Excel Time( Function to DAX

    I have a column of data that has a text string that represents a time of day.  Example if 55553 which is 5:55:53 AM.
    I need to convert the time to Eastern, and display in a time format.  Here is the formula I am currently using in Excel:
    =(TEXT([Time of Day],"00\:00\:00")+0)+TIME(1,0,0)
    Can you help me convert to a DAX approach please?

    Hi Scott,
    you need the TIME-function in DAX: TIME(hours, minutes, seconds)
    https://msdn.microsoft.com/en-us/library/ee634564.aspx
    With some combinations of LEFT & RIGHT Text-Functions, you should be able to pick out the needed numbers from your string. Very much like Excel.
    Imke

  • Convert system time into User local time.

    Hi,
    How to convert System time into User Local time.
    Are there any FMs available.
    Regards,
    Kiran

    hi,
    There is just one simple funda behind the Date and time logic in SAP.
    -> It is absolutely useless to store Date and time directly in DB. Why ?
    Because 00:00 a.m in London could mean 05:30 in India !! So If I (in India) store a Date 1st Feb 2008 , 10:00 a.m .. This time for a person in London could be invalid.. because he is behind your time zone..
    So the solution is to store the date/times in Timestamps format. Taking the above example.. 1st Feb 2008, 10:00 a.m (in India) will be stored as 20080201043000.
    This time if seen in German Time zone will look as : 1st Feb 2008, 05:30 a.m.
    Simple right
    -> In India we store date as DD.MM.YYYY while in other countries they store it as MM.DD.YYYY.
    The separator could be . or - or / .
    The date format is user dependent. I might prefer to store it as DD.MM.YYYY and you might want to store it as MM-DD-YYYY.
    System does not bother what your format is. It always stores in YYYYMMDD (8 Char)
    On screens if you want to display Date then it must always be shown in that users format who is seeing it. How to get this done ?
    DATA : lv_date(10) type c.
    write sy-datum into lv_date.
    So in LV_DATE variable the date will be stores in the users format.
    Simple right
    There are function modules that do the same. But normally we should avoid use of FM to make code simpler, short and easy... no complications at all ..
    You can use system variables sy-datlo (Local Date for Current User) and sy-timlo ( Local Time of Current User ).
    You can also use GET TIME statement.
    reward if useful,
    preet

  • Why is Ical not converting the time zones on email invites?  This is a big problem where my work is global.

    Why is my Ical not converting the time zones on email invites?  this has happend twice this week where someone has sent me an evite and it post improperly on the calendar. 

    My original post stated that I was having performance problems and the whole point of the post was to find out if there is a way of exporting the information out of Thunderbird and importing into a new profile. Nothing has changed. I was not looking for the standard methods of managing profiles, which are well documented on the web.
    Thunderbird appears to make use of a number of sqlite databases. My post was to see if there is anyone on the forum with sufficient knowledge about the database structure/usage to show me how to get the information out and import it to new databases. It is my view that some database corruption has taken place that is causing my performance problems. So, I wanted to get the data out of the databases, edit it as necessary, and get it back into new databases. I was hoping that the Thunderbird developers, or a third party, had a tool to help me with that.
    I suspect that the corruption has occurred due to hard disk errors or an unexpected shutdown at some point. I could be completely wrong, but as I have said, I have ruled out the obvious things. Having created a new "blank" profile I know that the performance problems are related to my existing profile. The new profile/Thunderbird performed without issues.
    If you have the expertise to show me how to do that then I would welcome your help. If you can show me that I am wrong in my assumptions then I would be interested to hear your views.
    So, nothing at all has changed. I previously logged a bug report on RSS feeds and I only raised the RSS issue as an example of why I think the obvious things are not applicable. Many users may have issues relating to anti-virus/firewall type problems but as I said in my original post, I am quite technical. The point of saying that was to make it clear that I am not a novice user. I also did quite a lot of searching via Google to see if I could find a solution before posting on this forum.
    So, nothing at all has changed from my original post.

Maybe you are looking for

  • Hard Coded Path Problem while using  WEBUTIL_C_API

    My 9i form is calling a C program using WEBUTIL_C_API it works fine with out any problem, if i hard code the path of DDL FILE as follows. f_handle := WEBUTIL_C_API.register_function('c:\winnt\system32\tabs.dll','buildit'); If i remove the hard coded

  • DirectAccess Load Balancing Error

    Hi  Just seeing if anyone has come across the following error when trying to enable Network Load Balancing in DA 2012. Error is The length of the prefix used to assign IPv6 addresses to DirectAccess clients connecting over IP-HTTPS should be 59 bits.

  • I can't update my iPod 5g to iOS 6.1.3

    Whenever I try to update my iPod touch 5g to iOS 6.1.3, first the installer takes an hour to download (but that's not the problem), then as soon as it finishes downloading, it says that there was some kind of unknown error - my iPod is now stuck in a

  • Volume buttons on a Compaq CQ61-313US

    My volume buttons do not work properly on me laptop. I have a Compaq CQ61-313US. I just got this laptop yesterday, December 1st. When I click on the plus, minus or mute, it does nothing. I have to change the volume with the volume icon in the taskbar

  • The maximum report processing jobs limit configured by your system admin...

    Hi There, I have two questions about this error. 1) How do you get rid of it after it happened.  I had to reboot. 2) What's the best way to dispose of the reportdocument object. I tried the code below, but it doesn't work:     protected void Page_UnL