date format - InfoPath Dev
in

InfoPath Dev

date format

Last post 10-27-2015 07:13 PM by bnvelarde. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 02-12-2010 11:41 AM

    date format

    I have a form that need to couple approvals. I try to put the concat the user name and current time to the signature field by setup a rule

    concat(Value[Name = "PreferredName"], " at ", now())

    It returns the time in 2010-02-12 T14:00:00 format. I would like to change it to US format 02/10/2010 2:00:00 PM. I cannot find any function to accomplish that other than set up another date/time field. But I need the signature and the time in a single field.

    So I created a hidden text field with the the following formula:

    concat(substring(today(), 6, 2), "/", substring(today(), 9, 2), "/", substring(today(), 1, 4), " ", substring(now(), 12, 8)).

    Checked "Update this value when the result of the formula is recalculated" option and replaced the now() with value of this field.

    However, this value never update, it always have the time when the form was created. Looks like the formula is never recalculated.

    Would anyone please let me know what is the problem. Many thanks. 

     

    Filed under: ,
  • 02-12-2010 01:33 PM In reply to

    translate(now(),"-T","/ ")

  • 07-19-2012 02:24 PM In reply to

    I have a similar issue but I think it probably has a simple solution.

     concat(Type, "-", "Effective Date:", Effective_Date)

    The Effective_Date fiel is a date picker that is formatted to display MM/DD/YYYY but when i add it to the concat formula, it displays YYYY-MM-DD.  Any ideas how to translate this field properly within the concat?

  • 07-23-2012 03:44 AM In reply to

    You can do this using the OP's method with substrings.

    Try:

    concat(Type, " - Effective Date:", concat(substring(Effective_Date, 6, 2), "/", substring(Effective_Date, 9, 2), "/", substring(Effective_Date, 1, 4)))

  • 07-24-2012 09:55 AM In reply to

    Thanks.  Works perfectly!  I haven't quite learned how to properly use the substring formula.

  • 11-20-2014 08:53 PM In reply to

    • Nonda
    • Not Ranked
    • Joined on 11-21-2014
    • Posts 1
    Hi. It doesn't work for me. I have here the date format which is mm/dd/yyyy but my question was ~ How can I display this format without this "/" sign so it would be displayed like this "mmddyyyy". I tried your formula but it displays like this "mdyyy". So what's the problem with my formula? Help me pls. THANKS
    Filed under:
  • 10-27-2015 06:00 PM In reply to

    translate(today(), "-","")
  • 10-27-2015 07:13 PM In reply to

    translate(today(), "-","")
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.