Data/Time format - InfoPath Dev
in

InfoPath Dev

Data/Time format

Last post 10-10-2005 08:40 AM by tatopitta. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 10-10-2005 06:39 AM

    Data/Time format

    Hi all,
    in my form I use data fields and time fields: in XML file they have the following formats:
    Date: yyyy-mm-dd es.(2005-08-29)
    Time: hh:mm:ss es.(20:59:59)

    are they in a international standard?what kind of standard is this? is there a method to save values in different standard methods (without using string fields)?

    Thank u!
  • 10-10-2005 06:46 AM In reply to

    I'm pretty sure that is the XML standard. The only way you could change formatting upon storage would be to use text strings. However, if you want to change format upon display you should be able to use a variet to methods to achieve whatever kind of display you would like. One would be Infopath's data type formatting. If you have a 'date picker' control you can click on the 'Format' button next to the data type drop-down and it gives you a whole list of formats to choose from, some even taking into account system settings. Otherwise, you could use code to read the data, format it however you want, and display it in a textbox.

    Interesting further reference:
    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=724
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 10-10-2005 07:15 AM In reply to

    Hi,

    I agree with Matt, the standard he is referring to is ISO 8601:
    http://weblogs.asp.net/wkriebel/archive/2004/05/05/126518.aspx

    Regards,

    Franck Dauché
  • 10-10-2005 07:51 AM In reply to

    Thank u guys, so Date is ISO8601...and time?only XML standard? :)
  • 10-10-2005 08:35 AM In reply to

    Hi,

    ISO 8601 is a complete Date/Time format:

    The formats are as follows. Exactly the components shown here must be present, with exactly this punctuation. Note that the "T" appears literally in the string, to indicate the beginning of the time element, as specified in ISO 8601.

    Year:
    YYYY (eg 1997)
    Year and month:
    YYYY-MM (eg 1997-07)
    Complete date:
    YYYY-MM-DD (eg 1997-07-16)
    Complete date plus hours and minutes:
    YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00)
    Complete date plus hours, minutes and seconds:
    YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00)
    Complete date plus hours, minutes, seconds and a decimal fraction of a
    second
    YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)
    where:

    YYYY = four-digit year
    MM = two-digit month (01=January, etc.)
    DD = two-digit day of month (01 through 31)
    hh = two digits of hour (00 through 23) (am/pm NOT allowed)
    mm = two digits of minute (00 through 59)
    ss = two digits of second (00 through 59)
    s = one or more digits representing a decimal fraction of a second
    TZD = time zone designator (Z or +hh:mm or -hh:mm)
    This profile does not specify how many digits may be used to represent the decimal fraction of a second. An adopting standard that permits fractions of a second must specify both the minimum number of digits (a number greater than or equal to one) and the maximum number of digits (the maximum may be stated to be "unlimited").

    This profile defines two ways of handling time zone offsets:

    Times are expressed in UTC (Coordinated Universal Time), with a special UTC designator ("Z").
    Times are expressed in local time, together with a time zone offset in hours and minutes. A time zone offset of "+hh:mm" indicates that the date/time uses a local time zone which is "hh" hours and "mm" minutes ahead of UTC. A time zone offset of "-hh:mm" indicates that the date/time uses a local time zone which is "hh" hours and "mm" minutes behind UTC.
    A standard referencing this profile should permit one or both of these ways of handling time zone offsets.


    --------------------------------------------------------------------------------

    Examples
    1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time.

    1994-11-05T13:15:30Z corresponds to the same instant.

    Regards,

    Franck Dauché
  • 10-10-2005 08:36 AM In reply to

    Thank u Franck :)
  • 10-10-2005 08:38 AM In reply to

    sorry but if i need to show only time fields?According to this standard, how do I rappresent, for example, 7.30 pm?
  • 10-10-2005 08:40 AM In reply to

    No matter, here
    http://www.iso.ch/iso/en/prods-services/popstds/datesandtime.html#two
    i got the answer :)
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.