Converting any date string to GMT standard

Hi All,
I want to convert any date string to GMT standard.
The date string may be like this.
"Sat Sep 15 14:23:40 IST 2001"
I have tried to change my defaultTimeZone .
But I don't know why it's not working.
Is there something to do with Locals?
Can anyone please tell me the way to
accomplish that ?
Thanks in advance.
Sujoy

Java stores all the dates in GMT Format , considering the machines TimeZone Setting ....and also i guess date has methods like toGMTString() and toLocaleString() . To convert the date to GMT i guess u can just say toGMTString() of the date . If u have the stringified version of date
just make a new Date(String) and then calling toGMTString of it .

Similar Messages

  • How to convert "any" date format to internal format

    Hi,
    I want to convert any date format  to internal format. Is there any function module ?
    The date formats could be:
    DD.MM.YYYY
    MM/DD/YYYY
    MM-DD-YYYY
    YYYY.MM.DD
    YYYY/MM/DD
    YYYY-MM-DD
    Thank you,
    Surya

    Hi,
    Check this sample program..It will convert sap supported external format to the internal format..
    PARAMETERS: v_char(10).
    DATA: v_date TYPE sydatum.
    DATA: v_period TYPE usr01-datfm.
    Get the format.
    DD.MM.YYYY
    IF v_char+2(1) = '.'.
    CONCATENATE v_char6(4) v_char3(2) v_char(2) INTO v_date.
    ENDIF.
    MM/DD/YYYY
    IF v_char+2(1) = '/'.
    CONCATENATE v_char6(4) v_char(2) v_char3(2) INTO v_date.
    ENDIF.
    MM-DD-YYYY
    IF v_char+2(1) = '-'.
    CONCATENATE v_char6(4) v_char(2) v_char3(2) INTO v_date.
    ENDIF.
    YYYY.MM.DD
    IF v_char+4(1) = '.'.
    CONCATENATE v_char(4) v_char5(2) v_char8(2)  INTO v_date.
    ENDIF.
    YYYY/MM/DD
    IF v_char+4(1) = '/'.
    CONCATENATE v_char(4) v_char5(2) v_char8(2)  INTO v_date.
    ENDIF.
    YYYY-MM-DD
    IF v_char+4(1) = '-'.
    CONCATENATE v_char(4) v_char5(2) v_char8(2)  INTO v_date.
    ENDIF.
    WRITE: / v_date.
    Thanks,
    Naren

  • How to convert any date format to default US format using javascript???

    Hi,
    I was trying to convert a date format to default US date format. The date format will vary according to different regions (It can be dd/MM/yyyy or MM/dd/yyyy or yyyy/dd/MM or any). I need to convert it in to MM/dd/yyyy always (US Format). Please give some
    solutions for the same.
    Warm Regards,
    Tony Joy

    hi
    it is not trivial task in common case. We faced with similar issue when tried to localize date times in display templates in Sharepoint 2013 depending on site's locale, which can be done only via javascript. In order to do it you need to add date time locale
    information from server side to client side, e.g. by defining global variable. See the following article for details:
    Localize datetimes in display templates in Content by search web parts in Sharepoint 2013. I extended OTB global object _spPageContextInfo with new property (as far as I remember this object is also available in Sharepoint 2010):
    <script type="text/javascript">
    jQuery(function() {
    if (typeof (_spPageContextInfo) != "undefined" &&
    _spPageContextInfo != null) {
    <%
    var ci = new CultureInfo(1033);
    var cultureSerialized = new JavaScriptSerializer().Serialize(
    new
    name = ci.Name,
    dateTimeFormat = ci.DateTimeFormat,
    numberFormat = ci.NumberFormat
    %>
    _spPageContextInfo.currentCultureSerialized = <%= cultureSerialized %>;
    </script>
    Having different date time formats for your locale, you may use
    Date.localeFormat function from MS Ajax for formatting the date in specific format. If in your case format is predefined you may hardcode it without adding DateTime formats from server side.
    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - http://camlex.codeplex.com

  • How to convert any date format?

    Hi,
    In the BPEL process I am getting the input in 'DD-MON-YYYY' format, I want to convert it to 'DD-MM-YYYY' format.
    The function xp20:formatDateTime('string', 'image') expecting the string to be in 'YYYY-MM-DD' format. and the 'image' can be set to any format.
    So i am able to convert to any format if I have the input string in 'YYYY-MM-DD' format, if I get in different format then how do I change them to required format?
    --Khaleel                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Looks like you are sending the date in Oracle format. If the date is created by a DB adapter the date should be formated in the correct format for BPEL to format (YYYY-MM-DDTHH:MI:SS). To make sure this happensyour xml needs to be the date data type and the value sent maust be a date not a string, if it is a string use the to_date to make it a date field.
    You are correct once it is in the YYYY-MM-DD format you can change to any format.
    cheers
    James

  • How can I convert output data (string?) from GPIB-read to an 1D array?

    Hello all,
    I am reading a displayed waveform from my Tektronix Oscilloscope (TDS3032) via the GPIB Read VI. The format of the waveform data is: positive integer data-point representation with the most significant byte transferred first (2 bytes per data point).
    The output data of GPIB-Read looks like a string(?) where the integer numbers and a sign like the euro-currency sign are seperated by spaces e.g. #5200004C3 4 4 4 4 3C3C3........ (C represents the euro-currency sign).
    How can I convert this waveform data into a 1D/2D array of real double floatingpoint numbers (DBL) so I can handle the waveform data for data-analysis?
    It would be very nice if someone know the solution for this.
    t
    hanks

    Hi,
    First of all, I'm assuming you are using LabVIEW.
    The first you need to do is parse the string returned by the instrument. In this case you need to search for the known symbols in the string (like the euro sign) and chop the string to get the numeric strings. Here are some examples on parsing from www.ni.com:
    Keyword Search: parsing
    Once you parse the numeric strings you can use the "String/number conversion VIs" in the String pallette.
    Hope this helps.
    DiegoF.Message Edited by Molly K on 02-18-2005 11:01 PM

  • Converting XML data string in to file object to parse

    Hi
    I have XML in the form of String .. i just want to convert this string in to a file to parse.. how can i do that ..<p>
    Here is my xml string<p>
    String str = "<?xml version="1.0"?>
    <!DOCTYPE some SYSTEM "some.dtd">
    <firsttag>
         <childtag>
              <name>some name</name>
              <age>age</age>
         </childtag>
    </firsttag>";<p>
    if u have code that would be great
    Thanks in advance

    Hi
    I have XML in the form of String .. i just want to
    convert this string in to a file to parse.. how can i
    do that ..<p>
    Why not to use RandomAccessFile to write string to file(you need to do this? is i'm right?)

  • Exist a class for Convert any data to miliseconds?

    Hi!
    I now how to convert current day data to miliseconds, but I don't now how to do it with other data's?
    If it exists what was the format?
    If someone now, could post here the code?
    Thanks

    Hi!
    What you told me was right, but something wrong was happening, look to my results:
    Milis :: 1021735555115
    TIME :: 16:27:34:235
    TIME in MILLISECONDS :: 1019143654235
    And here is the code!!!
    int d = 18;
    int m = 4;
    int y = 2002;
    int hr = 16;
    int mn = 25;
    java.util.Calendar c = java.util.Calendar.getInstance();
    c.set(y,m,d,hr,mn,55);
    long milli = c.getTimeInMillis();
    System.out.println("Milis :: " + milli);
    Calendar now = Calendar.getInstance();
    int hour = now.get(Calendar.HOUR_OF_DAY);
    int min = now.get(Calendar.MINUTE);
    int sec = now.get(Calendar.SECOND);
    int millis = now.get(Calendar.MILLISECOND);
    System.out.println("TIME :: " + hour + ":" + min + ":" + sec + ":" + millis);
    long baseTime = now.getTimeInMillis();
    System.out.println("TIME in MILLISECONDS :: " + baseTime );
    The current hour is 16:28 and what I put in your test is 16:25
    and in milliseconds 16:25>16:28 !
    :( I don' t understand ...
    Thanks
    Andreia

  • Converting Date Strings to Months

    I need to know how I can convert a Date String to a Month.
    For example, my Date String is 2/19/09, I need this converted to return February.   I need one formula which will take in account for all months.
    I am currently using the following to convert to a date, but I'm not sure how to then convert this to return a month... January - December.
    CStr({?EndDate},"yyyy-MM-dd")
    Thank you in advance for your assistance.

    Thank you so much, this does give me the month.
    How can I use this to group my report by month and then under it by received date?
    For example...
    February
        2/1/09     Ticket information.....
        2/2/09     Ticket information.....
        2/18/09   Ticket information....
    March
        3/1/09     Ticket information.....
        3/2/09     Ticket information.....
        3/18/09   Ticket information....
    And so on....
    Thanks again in advance.
    Edited by: Gary Timm on Feb 19, 2009 6:02 PM

  • How to Convert Cluster to String

    Here is a VI to convert any data to a String, and the VI to convert the String back to a Variant.  Use the Variant to Data function to convert back to your data type.  I use LV 8.2, please rate if it helped you. Thanks.
    -Branson
    Solved!
    Go to Solution.
    Attachments:
    data-string-data labview 8.2.PNG ‏6 KB
    to_String 1.vi ‏19 KB
    String_to 1.vi ‏21 KB

    OK. Can open them now.
    From a programmatic perspective and usability perspective, what do you see as the main advantage of this method as opposed to using the Flatten To String and Unflatten From String functions without going through an intermediate variant? Or, perhaps, the Flatten to XML/Unflatten from XML functions. In other words, what are the pros and cons of your method as opposed to this method:
    One clear advantage of your method clearly is that you do not need to wire in the data type, as you need to do with the Unflatten From String function. Were you addressing other concerns?
    Message Edited by smercurio_fc on 10-12-2008 11:04 AM
    Attachments:
    Example_VI_BD.png ‏3 KB

  • Convert Epoch Date Time to Date Time format

    I am trying to convert Epoch Date time in GMT to Human Readable Date time format in UTC. I used the one below but it returns just the date in GMT but how can get datetime in UTC ?
    select To_Char( To_Date( '01.01.1970 06:00:00','DD.MM.YYYY HH24:Mi:Ss') + STARTIME / 86400,'DD.MM.YYYY HH24:Mi:ss') FROM HQ_AVAIL_DATA_RLE;
    I refered a couple of forums and applied everything, but still I wouldn't get the timestamp.
    Please note that i'm looking for datetime stamp, not just the date.
    Thanks in advance!
    Edited by: 830754 on Jan 27, 2011 11:18 AM
    Edited by: 830754 on Jan 27, 2011 11:19 AM

    Works for me. I see date and time (submitted 1000 for STARTTIME):
    select To_Char( To_Date( '01.01.1970 06:00:00','DD.MM.YYYY HH24:Mi:Ss') + 1000 / 86400,'DD.MM.YYYY HH24:Mi:ss')
    from dual
    TO_CHAR(TO_DATE('01
    01.01.1970 06:16:40Or do you mean something else?

  • I have a string 2012-05-22T23:23:42.263-07:00. so i want to convert in date with indian time zone   can any one help me out

    i have a string 2012-05-22T23:23:42.263-07:00. so i want to convert in date with indian time zone   can any one help me out

    What does this have to do with iPhone tech support?

  • How to convert server specific date string into client specific date object

    Hi developers,
    I have a very complex issue to convert the server date string format "EEE MMM dd HH:mm:ss z yyyy" into java.util.Date object and find the difference of the client machine date to represent the elapsed time
    The problem is the server time zone and client time zone are not unique and when I try to covert the server date which is in string format to date format using SimpleDateFormat class , I got the server time as 3:30 hours appended to it. The server time zone is in IST and Client time zone format is GMT+5:30 , the appended time of 3:30 hours created the confusion in calculating the elapsed time between the server started time and client requested time
    I went through all the sites but none of them were useful
    If any help to solve the above issue is appriciated
    please send the response with the same subject line
    Advance Thanks

    Why don't you just subtract from the server time the 3:30 hours (consult api of java.util.date) before comparing with the client date? Hard to see where's the problem...

  • 'DATE' type in SQL converting to a 'STRING' in CR2008.

    Help!
    We have just installed the stand-alone version of CR2008 and running against a SQL db back end. The newest version of SQL consists of a data type, 'DATE' that's being recognized in CR as a 'STRING' when the stored procedures are accessed. However, I am converting it back to a 'DATE' data type inside the report and everything looks fine in the CR viewer.
    Our concern:
    Could this be an issue when the .rpt files are called via an ASP page?
    Thanks,
    Tony

    Hi Tony,
    I just checked by adding a Date field type into my 2K8 server and you are correct if you use the Native SQL Server driver. CR does see it only as a string. By default and to handle new types that DB makers can add, CR will convert any type is doesn't recognize into a string.
    However if you install SQL Server Client 10 driver and use it then you will see the Date field as a date type.
    So, if you are using MS SQL Server 2008 then simply install the Client and then you can use the SP.
    You can install it off the MS CD or use this link to their tools:
    http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C6C3E9EF-BA29-4A43-8D69-A2BED18FE73C&displaylang=en
    Look for the Client install only, 32 or 64 bit.
    Thank you
    Don
    Edited by: Don Williams on Nov 20, 2010 12:39 PM

  • FM to convert Date Entered to a standard format

    Hello All,
    Is there any FM to convert the date entered (in the format given in SU01) to a standard format
    (Eg: DD.MM.YYYY).  Is there any FM that does the reverse of it.
    Please help us out with your suggesstions.
    Thanks,
    Seetharaman V

    Hi seetharaman,
    please refer the following link for using the conversion exit for date in BSP application.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/72d7ac11-0501-0010-63a2-cc6960569926
    hpe this ll help.
    thnks.

  • ORA-01830: date format picture ends before converting entire input string at OCI call OCIStmtFetch

    Hi all,
    We are trying to create a BIP Data Model based on an Answer, but after selecting report, it hangs when I try to Apply to create a query based on Oracle BI. When I try to open the query in aswers, going to results tab I'm getting this error (OBIEE 11.1.1.6.2):
    ORA-01830: date format picture ends before converting entire input string at OCI call OCIStmtFetch
    I suppose that BIP data model is not able to create it because of this error. But this answer is working fine inside dashboards, etc. It only does not work when editing it. Query is doing something like this: "USING "- Collection Attributes"."Due Date" >= TIMESTAMPADD(SQL_TSI_DAY, -30, CAST ('01/04/2009' AS DATE))"
    Any ideas?

    Solved watching date format in generated SQL and changing default date format in presentation variables default values inside criteria according to SQL format.

Maybe you are looking for

  • Polish and Czech characters not displaying

    Hi Experts, I have to display the characters in Polish and Czech in adobe reader XI. Currently the text displays in unreadable format. Can anyone please help how this can be rectified? Thanks Tridib

  • From Japan to Dubai i cant use my Iphone

    Hello Guys,.. my sister working in japan..and she give a gift in my wedding.. Iphone 3gS 32gig...and when try to sim card... the sim card its not working.. but when put back my sim card in my old mobile..it's 100% working.., and my frind told me to j

  • Unix and XI...Query

    Hi, I just want to know how I can Interface with an Unix System. The Business Case is that there is a Unix system which captures some Inventory data and then at the end of Half day they Download the data in EXCEL and do a BDC upload...   How can XI b

  • Statistics missing for some tables in sys after scheduler job ran

    In a 10g database, the scheduler automatically has the job set up to gather the statistics for the sys schema. I noticed the job was disabled for some reason so I enabled it yesterday and it ran last night. I didn't see any errors for last night's sc

  • IOS 5.1 sync fail to start

    Just updated to iTunes 10.6 and iOS 5.1 on iPhone 4S. Despite repeated attempts, including turning "sync over wi-fi" off, sync fails to start.