2 Replies Latest reply on Jul 6, 2006 6:21 AM by Newsgroup_User

    CF 101. Time output format

    Level 7
      Good morning all

      I can't for the life of me figure out how to output today's day in this
      format

      July 06, 2006 09:28

      My problem is the time. The server clock is 2 hours behind the clients time.
      I need the time display +2 hours using the 12 hour clock

      here's what I have so far
      <cfset dateNow = Now()>
      <cfset NewDate = '#LSDateFormat(dateNow, "mmmm d, yyyy")#
      #LSTimeFormat(dateNow)#'>

      Now to get the hours to display +2 without mucking things up once the hour
      reaches 11:00

      TIA

      Bill


        • 1. Re: CF 101. Time output format
          Beardydude
          Try

          <cfset dateNow = dateAdd('h',2, Now())><!-- add 2 hours to the date and time now -->
          <cfset NewDate = '#LSDateFormat(dateNow, "mmmm d, yyyy")# #LSTimeFormat(dateNow, 'hh:mm')#'>

          Adding 2 hours to Now() means that it will roll over at the right point.
          • 2. Re: CF 101. Time output format
            Level 7
            That's what I was after. Thanks a million.

            Bill
            "Beardydude" <webforumsuser@macromedia.com> wrote in message
            news:e8j1g8$9rs$1@forums.macromedia.com...
            > Try
            >
            > <cfset dateNow = dateAdd('h',2, Now())><!-- add 2 hours to the date and
            > time
            > now -->
            > <cfset NewDate = '#LSDateFormat(dateNow, "mmmm d, yyyy")#
            > #LSTimeFormat(dateNow, 'hh:mm')#'>
            >
            > Adding 2 hours to Now() means that it will roll over at the right point.
            >