1 Reply Latest reply: Jan 31, 2013 1:22 AM by sujeet Singh RSS

    How to create a Clock Object using a field(yyyy-mm-dd HH:MM:SS)

      Hi Friends,

       

      I have a field time_in(value is like 2013-01-23 04:51:41.300) and I want to create a clock with it.

       

      something like:

      if(subfield( subfield(time_in, ' ',2), ':',1) =00, '00-01 HRs',

      if(subfield( subfield(time_in, ' ',2), ':',1) =01, '01-02 HRs', 

        if(subfield( subfield(time_in, ' ',2), ':',1) =02, '02-03 HRs', 

         if(subfield( subfield(time_in, ' ',2), ':',1) =03, '03-04 HRs', 

          if(subfield( subfield(time_in, ' ',2), ':',1) =04, '04-05 HRs', 

           if(subfield( subfield(time_in, ' ',2), ':',1) =05, '05-06 HRs', 

            if(subfield( subfield(time_in, ' ',2), ':',1) =06, '06-07 HRs', 

             if(subfield( subfield(time_in, ' ',2), ':',1) =07, '07-08 HRs', 

              if(subfield( subfield(time_in, ' ',2), ':',1) =08, '08-09 HRs', 

               if(subfield( subfield(time_in, ' ',2), ':',1) =09, '09-10 HRs', 

                if(subfield( subfield(time_in, ' ',2), ':',1) =10, '10-11 HRs',

                 if(subfield( subfield(time_in, ' ',2), ':',1) =11, '11-12 HRs',

                  if(subfield( subfield(time_in, ' ',2), ':',1) =12, '12-13 HRs',

                   if(subfield( subfield(time_in, ' ',2), ':',1) =13, '13-14 HRs',

                    if(subfield( subfield(time_in, ' ',2), ':',1) =14, '14-15 HRs',

                     if(subfield( subfield(time_in, ' ',2), ':',1) =15, '15-16 HRs',

                      if(subfield( subfield(time_in, ' ',2), ':',1) =16, '16-17 HRs',

                       if(subfield( subfield(time_in, ' ',2), ':',1) =17, '17-18 HRs',

                        if(subfield( subfield(time_in, ' ',2), ':',1) =18, '18-19 HRs',

                         if(subfield( subfield(time_in, ' ',2), ':',1) =19, '19-20 HRs',

                          if(subfield( subfield(time_in, ' ',2), ':',1) =20, '20-21 HRs',

                           if(subfield( subfield(time_in, ' ',2), ':',1) =21, '21-22 HRs',

                            if(subfield( subfield(time_in, ' ',2), ':',1) =22, '22-23 HRs',

                             if(subfield( subfield(time_in, ' ',2), ':',1) =23, '23-00 HRs'

      )))))))))))))))))))))))) as TimePeriod,

       

      I can do this easily with script and show it in a list box but I want to show it like a clock.

       

      Can anyone help me here?

       

      Thanks in advance!

      Sumita