How would you set the default date and time of date picker control to 2 days from now() at 5:00 PM? - InfoPath Dev
in

InfoPath Dev

How would you set the default date and time of date picker control to 2 days from now() at 5:00 PM?

Last post 12-20-2011 01:12 PM by Scott Rooke. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-20-2011 12:43 PM

    How would you set the default date and time of date picker control to 2 days from now() at 5:00 PM?

    I have searched high and low with no success to figure this one out. I hoping it's just around the corner from me now. I have a date picker control on my form that I'd like to set the date and time port of the control to 2 days from today at 5:00 PM. I'm able to use the addDays(date, number of days) function to set the date portion but it is not clear how I would sent the time portion of this equation. When I click on the properties for the time portion of this field and try to set the default value, the date portion is already in the default value field.

    Can anyone provide any insight here?

    Thanks!

    Scott
  • 12-20-2011 12:51 PM In reply to

    Re: How would you set the default date and time of date picker control to 2 days from now() at 5:00 PM?

     Hi Scott,

    This should be possible with addDays and concat. I've put together a sample for you, attached. Hope it helps.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 12-20-2011 01:12 PM In reply to

    Re: How would you set the default date and time of date picker control to 2 days from now() at 5:00 PM?

    So sweet Ernesto!!!! 

    I almost tried the concat() function but wasn't sure how to add the time portion.  The "T" would have been something I would have missed even though I know its part of the date/time DNA. 

     Thank you!!!  Works great!

     Scott

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.