Converting to UTC time format

Hi ,
      I would like to convert the time retrieved from the database to UTC format. Do you have any idea how this possible in MII?
Is there any inbuilt method in MII for doing this
Thanks
Shaji

Hello Shaji,
in my opinion a real time zone conversion cannot be achieved by using the MII functions and standard actions. I wrote my own MII action. It looks something like this:
private static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
@Action(name = "TimeZoneConverter")
@Outputs(names = { "OutputDate" }, types = { VariantDataTypes.STRING })
public boolean run(IActionInstance action,
  @Input(name = "InputTimeZone") String inputTimeZone,
  @Input(name = "InputDate") String inputDate,
  @Input(name = "OutputTimeZone") String outputTimeZone)
  throws InvalidVariableException, DataConversionException {
  SimpleDateFormat inputDateFormat = new SimpleDateFormat(DATE_FORMAT);
  inputDateFormat.setTimeZone(TimeZone.getTimeZone(inputTimeZone));
  Date date = inputDateFormat.parse(inputDate);
  SimpleDateFormat outputDateFormat = new SimpleDateFormat(DATE_FORMAT);
  outputDateFormat.setLenient(true);
  outputDateFormat.setTimeZone(TimeZone.getTimeZone(outputTimeZone));
  action.setActionResult("OutputDate", outputDateFormat.format(date));
  return true;
Regards,
Martin

Similar Messages

  • How to convert 12 hour time format to 24 hour time format ?

    Hi,
    How to convert 12 hour time format to 24 hour time format is there any FM if not, please suggest me how to convert .
    regards,
    rakesh

    Hi,
    Have you tried function module HRVE_CONVERT_TIME
    Input parameters will be like
    TYPE_TIME                       B
    INPUT_TIME                      01:00:00
    INPUT_AM_PM                  PM
    Output
    OUTPUT_TIME                     13:00:00
    Regards

  • Delivery of reports with different local timezone convert from UTC time

    I have a central database storing events with UTC time (current location is Europe). I have a request to send historical reports (e.g Aug 2013 report) to US, Asia and I required to convert the UTC time to US and Asia when generating reports. I am thinking
    the best way of design the dimension table, shall I have a history timezone table to match the utc time id with US and Asian timezone in order to do the historical report time conversion , considering the daylight saving condition as well. Any suggestions
    are welcome. Thanks.

    What version of SQL Server you are using? How do you generate reports? If it is SQL Server 2012 take a look at
    --Retrieve the current time as a datetimeoffset (comparable to the venerable GETDATE function):
                    SELECT SYSDATETIMEOFFSET()
    ---Retrieve the server’s current time zone offset (the number of minutes before or after UTC):
                    SELECT DATENAME (TZoffset, SYSDATETIMEOFFSET())
    ---Convert from datetime to datetimeoffset (note that this uses the server’s current time zone offset, which could be inappropriate for historical dates):
                    SELECT TODATETIMEOFFSET (datetimevalue, DATENAME (TZoffset, SYSDATETIMEOFFSET()))
    ---Convert a datetimeoffset value (in this case, local server time returned by SYSDATETIMEOFFSET) to a new time zone offset:
                    SELECT SWITCHOFFSET (SYSDATETIMEOFFSET(), '-05:00')
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Converting / transforming one time format to another

    Hi Experts,
          i want to contvert time in format ex. 10:30:00 to a format without colon i.e 103000.  I tryed using Date Trans funinon by giving source as HH:mm:ss as source and target as: HHmmss. when tryed and tested  li i am getting error:  "Runtime exception during processing target field mapping"
    i am getting only time  to the XI box not the date.
    Thanks,
    Siva

    Hi Siva !
            This sounds very estrange to me, the formats that you specified is correct. The only situation that I know that TransformDate generates error(considering that the formats are correct, as I think that is your case), is when the source field is empty.
            Well, a single way to solve your need, and avoid the error that I mentioned above(when the source field is empty), is to use the replaceString function to replace colon(':') with empty(''), so, 10:10:00 will lead to 101000. I used this solution several times.
            I hope this helps !
            Best regards,
            Wilson
    Edited by: Wilson Santos on Jul 10, 2008 9:23 PM

  • 24 hr time format

    Hi All,
    Is there a method in jave to convert 12 hr time format to 24 hr time format?

    You've been given all required information.
    - Process has been explained in reply#1
    - Your pattern for parsing is wrong (as told in reply#4):
    a - Am/pm marker
    H - Hour in day (0-23)
    h - Hour in am/pm (1-12)
    - Read the API docs (link already posted in reply#3)

  • 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?

  • Date format(UTC Time Stamp in Short Form (YYYYMMDDhhmmss)

    Hello Everybody,
                            I am facing a problem regarding creating an update program. The program will pick up data from a DB table through the RFC: RFC_READ_TABLE and then it will modify the custom DB table present in the system from where the program will be executed. Among the data of the fields to be transfered date field will be present but the format is of UTC Time Stamp in Short Form (YYYYMMDDhhmmss). Data is coming properly inside the internal table of the program, but on encountering a MODIFY or an INSERT statement its giving a short dump with a message: In a statement an invalid request was made to the database interface when accessing table "ZZTTT". What to do to transfer the data for the date field for the above said format. Eagerly waiting for your reply. Enclosed below the domain of the data element used in the table:
    Domain name: TZNTSTMPS(Data Type:DEC, No of Char: 15, Output Length: 19)
    Regards,
    Pulokesh

    data : d like sy-datum.
    CONVERT TIME STAMP tstamp TIME ZONE 'UTC' INTO
            DATE d TIME t.
    Check also fm : 'CIF_GEN3_CONVERT_TIMESTAMP'
    Hope this helps,
    Erwan

  • How to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format

    Hi All,
    I have a requirement in my project like to convert the date time from one format to another.my situation is like to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format. I am using the soa suite 11.1.1.6.
    Can any one suggest me how to convert in the BPEL transformation.
    Thanks,
    Sanju.

    Hi Sanju,
    Store the date to be converted into a variable viz. dateVar. Now, process an expression in assign as: xp20:format-dateTime($dateVar,'[Y0001]-[M01]-[D01] [h]:[m01]:[s01]').
    Regards

  • 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

  • Converting zulu format to date and time format

    I want to convert zulu format to regular dateand time format. so for e.g I have this date and time in my table
    021731ZJUN06, I want to convert it to 2006-06-02 17:31:00
    I wrote this in sql server, but don't know how to do this in oracle
    ALTER function [dbo].[ZULUToDateTime](@initDate varchar(20))
    RETURNS datetime
    AS
    BEGIN
    DECLARE @NewDate datetime
    SET @NewDate = NULL
    IF @initDate <> 'false'
    BEGIN
         SET @NewDate=     CONVERT(datetime,LEFT(@initDate,2)+ ' ' + STUFF(right(@initDate,5),4,0,' ') + ' ' +STUFF(SUBSTRING(@initDate,3,4),3,0,':'),121)  
    END
    RETURN @NewDate
    END

    Like this?
    SQL> select to_date('021731ZJUN06', 'ddhh24mi"z"monrr')
      2  from dual;
    TO_DATE('021731ZJUN0
    02-jun-2006 17:31:00Gotta love Oracle's date formatting fuctions :-)
    The format above is my default session format, if you explicitly want the format you showed, you need an extra to_char like:
    SQL> select TO_CHAR(to_date('021731ZJUN06', 'ddhh24mi"z"monrr'), 'yyyy-mm-dd hh24:mi:ss')
      2  from dual;
    TO_CHAR(TO_DATE('021
    2006-06-02 17:31:00John
    Edited by: John Spencer on Nov 10, 2011 1:45 PM
    Added correct output format.

  • GregorianCalendar datetime format convert to  sql server date time format

    please help me
    my GregorianCalendar date time format is like this. *08/01/29 02:25:59* . I try to insert my database(sql server 2000 )
    data type is datetime ,in my database table display like this *2029-08-01 02:25:59.000* .can you help me to insert correct date in my database table like ( . *08/01/29 02:25:59*)

    use [PreparedStatement |http://java.sun.com/javase/6/docs/api/java/sql/PreparedStatement.html] and setTimestamp:
    [http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html]

  • Convert epoc time format

    anyone know how to format a epoc time format to a normal time
    string?
    I am new so i am praying there is some actionscript function
    that does this....

    hi ,
    try out this , but not sure
    data: number type f value '2,980000000000000+04',
          time type syuzeit.
    move number to time.
    write time.

  • Timestamp always converted to UTC?

    In applying the "Get Date/Time" function and "Date/Time to seconds", it looks like they force UTC after conversion, even if the option for UTC is FALSE.
    I would like to have the actual system date and time available (that accounts for DST and timezone as shown on my PC)  at the timestamp output, but instead I keep getting a value for the timestamp that (I assume) is UTC. When I probe the timestamp output, or the cluster output, it looks correct. However upon evaluating the timestamp number, it is always off by what looks like the DST and timezone difference (exactly 5 hours).
    I have tried two  different methods and find the same results;
    1) Output of "Get Date/Time" function directly (which states the timestamp will be Universal Time in its contextual help file)
    and
    2) Converting the timestamp to a cluster and reconverting it timestamp (as shown in picture).
    In the example picture attached, notice that the cluster output (Probe 25) shows the correct hour (16) when broken down and the timestamp probe (Probe 26) looks correct.
    However, when the timestamp of either the "Get Date/Time" function or the "Date/Time to seconds" function is converted to U32, the time changes to what looks like UTC time as the timestamp 3485539686 (Probe 28) has the 5 hour offset (21 hours as shown in the Excell sheet calculations included in the picture).
    I do not want to simply subtract 18,000 seconds to account for this difference (as changes in DST or timezone could cause problems). I would like the actual PC time to be used for the array build.
    How can I do this?
    Why do the probe points show the correct system time, but right after timestamp is coverted to U32 it looks like UTC?
    Solved!
    Go to Solution.
    Attachments:
    Timestamp UTC.png ‏40 KB

    Circuitmage wrote:
    1st, thanks for the suggested methods stated above. I only have access to the LV development package at work, so I have not yet had a chance to try the suggestions yet.
    2nd, I am sorry if I was not specific enough to provide more information. If stating I would like to keep the method shown in the picture as intact as possible and that I need the local time added to the array data is not enough, then I cannot state anymore details.
    @rolfk,  I can not argue about the validity of my problem, only look for solutions. I believe it is valid. If there is no solution based on the limitations of LV then I will leave it at that.
    He's just trying to stop you from driving the bus off the cliff.  Once you manipluate a timestamp like that, it loses its meaningfulness.  It no longer represents the amount of seconds elapsed since 01/01/1904.  If it is not meant to be seen by a human, it shouldn't matter about the format (because there is no format).  If it IS to be seen by a human, just convert it to a string for the report.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Difference between LV 6.1 and LV 7.0 - Date\Time Format

    I found different behviour of numeric controls in Date/Time format, or
    in "Seconds to Date\Time String" function in LV6.1 and LV7.0
    In LV 6.1:
    Absolute time in seconds is formated in control with date/time format,
    output depends on local time format on computer, where this VI runs.
    So if I start LabView on machine with specific time zone, and for
    example DST on, the output was changed by these settings. ANY number
    of second is handled by this settings.
    In LV 7.0:
    Output still depends on specific time zone, but the use of the DST
    on/off depends on absolute time value. So if the number represents
    absolute time which fits period when DST was off, the output is
    wihtout DST, even if the DST is on when this vi runs.
    The solution in LV 7.0 is much more better than in LV 6.1, but ...
    If data are measured and stored (store of absoulte time DBL) in one
    time zone, and if they are processed in different time zone (for
    exapmle where DST change is in different time), the data
    representation is wrong.
    In LV 6.1 it was not correct too, but anyway there was a way how to
    solve this problem:
    I stored absolute time DBL and GMT delta for every time stamp. When I
    process this stored data on different computer with different time
    zone, I recalculate time stamps in this way:
    absolute time + stored GMT delta - GMT delta of computer where data
    are presented.
    So in final I have correct time does not matter on time zone or any
    other settings which are on computer where are data presented.
    But on LV 7.0, the GMT delta is not constant for every data and this
    algorithm is useless. I can simply show correct time when data are
    from same time zone without any calculation, but it is almost
    imposible to correct show data
    from different time zone.
    My question is:
    Is there any "ini file item", which can tell LabView 7.0 to use time
    representation style as in LV 6.1 ?
    Thank you and best regards
    Jiri Hula

    Thanks for the well written question.
    Unfortunately, there is no ini token or any way of specifying LabVIEW use the LV 6.1 style.
    I am attaching a LabVIEW 7.0 VI that calculates the UTC Offset for a given time value (I don't think the same code would work correctly in LabVIEW 6.1). The VI comments are:
    The attached VI will take Daylight Saving and Time zone into account to compute the offset in seconds from UTC Time to the Local time (as specified by the computer). Note: This VI can aid in converting from Local Time to UTC time, but not in converting from one Timezone to another.
    I hope it helps. Basically, your data is in UTC (absolute time) as it has always been, but LabVIEW 7.0 changed the way it displays the UTC data (trying to be more correct). If you wish to display it the way it was in LabVIEW 6.1, things are going to get a little tricky. LabVIEW 6.1 displayed the same DBL absolute time differently depending on if the current computer time was in DST or not. To get this behavior in LabVIEW 7.0, the equation:
    absolute time + stored GMT delta - GMT delta of computer where data are presented
    is still correct, but for LabVIEW 7.0 the GMT deltas now vary depending on whether the absolute time is in DST or not. It may be possible to convert the GMT offset you have saved from LabVIEW 6.1 into a set or pair of UTC Offsets. This would require a knowledge of what the DST state was for each of the data points in question.
    The DST state or GMT/UTC offset that the computer currently is using may be obtained from the attached VI.
    The absolute time is stored in GMT/UTC so that in different time zones it will still equate to the same time, even though it will be displayed differently. Another data format (such as storing the Hour, Minute, Second, Day, Month, Year; or storing the date as a string) might be more appropriate if the time should be displayed as the same local time regardless of the time zone.
    I hope this helps. Please respond if you have any comments or questions.
    Shawn Walpole
    Attachments:
    GetUTCOffset.vi ‏52 KB

  • Convert date and time in decimal characters

    Hi,
    I need to convert the date ad the time in decimal characters.
    Any idea to do this ?
    TNX in advance for your help
    Alex

    Alex,
    Please find the attached example. It displays the current time in time format, and it also has separate numeric indicators for hours, minutes, seconds.
    If this is not what you were trying to do, please elaborate on your question.
    The VI was created with LabVIEW 6.1
    Zvezdana S.
    National Instruments
    Attachments:
    Timer.vi ‏40 KB

Maybe you are looking for

  • ERP_H Component is not having Payment Card funtionality in CRM 7.0 Web UI

    Hi Experts, In ECC 6.0 while creating sales order in header we have "Payment Card" tab which can be used to enter credit card details and some authorization functionlity.  But this functionality is not available in ERP_H component.  I hope the Paymen

  • Single network connection using multiple profiles

    Apologies if this has already been asked - I have searched! Is there a way of setting up netcfg - or a wrapper script - so that it tries multiple profiles  but then stops when it finds one that works?  These profiles might be a mix of wired or wirele

  • Tip for upgrading from MBP to iMac with Leopard & Parallels Boot Camp

    Here are some pointers based on my recent experience upgrading from a MacBook Pro to an iMac, under Leopard and with Parallels using a Boot Camp partition for Windows. First, you do not need to create a Windows partition on your new computer. You wil

  • Themes are mixing

    Hey! I have a book with two pages inside, and each page has applied its own theme. Each theme have it's own javascript and css includes. Themes works, the problen that i'm facing right now is that all pages (two pages) are including ALL javascripts a

  • Just upgraded to latest virsion now I have none of my addons available!

    I have just upgrade to the latest version of Firefox as recommended to fix security issues. Now, unfortunately, I can no longer access any of my add-on. A few of which are very important to me as I use them extensively.