10 Replies Latest reply on Aug 9, 2014 10:49 AM by AustinEckman

    Custom Formatted Timestamp

    AustinEckman

      Title

      Custom Formatted Timestamp

      Post

           I would like to be able to recreate the timestamp feature. I currently have it set up so I can click a button to insert the timestamp; but I would like only to see the date, hours, and minutes (no seconds). I would also like to see the name of the day. I haven't had any luck messing around with code and was wonder if anyone can lead me in the correct direction. Thanks!

        • 1. Re: Custom Formatted Timestamp
          philmodjunk

               Keep your field defined as a timestamp. Use data formatting in the inspector to format the appearance of the field. You can use the date controls to format the date portion of the field and the time controls  to format the time portion of the field.

          • 2. Re: Custom Formatted Timestamp
            AustinEckman

                 The only issue with that is i'm using a button to insert a timestamp in different fields not just one. Its working right now with  

                 Insert Calculated Result [Get ( CurrentTimeStamp )]

                 I would just like to be able to change how the timestamp looks.

            • 3. Re: Custom Formatted Timestamp
              philmodjunk

                   Set field is usually a better option than an Insert step though there are exceptions.

                   The data formatting that I described does exactly what you have requested. It changes how the date and time of the timestamp looks.

              • 4. Re: Custom Formatted Timestamp
                WBSimon
                     How is this for a start?
                      
                     Right(Year(Get ( CurrentDate ));2)  &
                     If( Month( Get ( CurrentDate ) ) < 10 ; "0" ;"" )  & Month(Get ( CurrentDate ) ) &
                     If( Day(Get ( CurrentDate ) ) < 10 ; "0" ;"" )  & Day( Get ( CurrentDate ) ) & "." &
                     If( Hour( Get ( CurrentTime ) ) < 10 ; "0" ; "" )  & Hour( Get ( CurrentTime ) )  & 
                     If( Minute( Get ( CurrentTime ) ) < 10 ; "0" ; "" ) & Minute( Get ( CurrentTime ) ) & 
                     If( Seconds( Get ( CurrentTime ) ) < 10 ; "0" ; "" ) & Seconds( Get ( CurrentTime ) ) 
                • 5. Re: Custom Formatted Timestamp
                  philmodjunk

                       You can also use all the date and time functions, MonthName, dayName, Hour, Minutes, etc with a timestamp--either directly or by first enclosing the value in GetAsDate or GetAsTime.

                       But this should not be necessary if all you are doing is assigning a timestamp value to a timestamp field.

                  • 6. Re: Custom Formatted Timestamp
                    AustinEckman

                         I am trying to post a timestamp in where I need to using the button, there will be more data in the field than just timestamps. If I set the field to it all the other data would be removed. Thanks Mr. Simon I will try this when I can.

                    • 7. Re: Custom Formatted Timestamp
                      AustinEckman

                           All i'm getting back is 140808.194749. Probably because Im using insert calculated result and its not text. Not sure if thats the problem tho. 

                      • 8. Re: Custom Formatted Timestamp
                        WBSimon

                             The calculation is correct with what I gave you. YearMonthDate.HoursMinutesSeconds. Thought it would nudge you in the right direction.

                              

                             What exactly do you want it to look like?

                        • 9. Re: Custom Formatted Timestamp
                          AustinEckman

                               Ive changed it to 

                               Right(Year(Get ( CurrentDate ));2) 
                                & "/"
                               &If( Month( Get ( CurrentDate ) ) < 10 ; "0" ;"" )  
                               & Month(Get ( CurrentDate ) ) 
                                & "/"
                               &If( Day(Get ( CurrentDate ) ) < 10 ; "0" ;"" )  
                               & Day( Get ( CurrentDate ) ) 
                               & " " 
                               &If( Hour( Get ( CurrentTime ) ) < 10 ; "0" ; "" )  
                               & Hour( Get ( CurrentTime ) )  
                                & ":"
                               & If( Minute( Get ( CurrentTime ) ) < 10 ; "0" ; "" ) 
                               & Minute( Get ( CurrentTime ) )
                                
                               But I would also like to have the name of the day in there. Thanks for the help I was tired last night and didn't notice what I was looking at. This gives me 14/08/09 13:43. I would like to see something such as Saturday, 09/08/14 13:43.
                          • 10. Re: Custom Formatted Timestamp
                            AustinEckman
                                 DayName ( Get( CurrentDate) )
                                  & ", "
                                 &If( Month( Get ( CurrentDate ) ) < 10 ; "0" ;"" )  
                                 & Month(Get ( CurrentDate ) ) 
                                  & "/"
                                 &If( Day(Get ( CurrentDate ) ) < 10 ; "0" ;"" )  
                                 & Day( Get ( CurrentDate ) ) 
                                 & "/" 
                                 & Right(Year(Get ( CurrentDate ));2) 
                                  & " "
                                 &If( Hour( Get ( CurrentTime ) ) < 10 ; "0" ; "" )  
                                 & Hour( Get ( CurrentTime ) )  
                                  & ":"
                                 & If( Minute( Get ( CurrentTime ) ) < 10 ; "0" ; "" ) 
                                 & Minute( Get ( CurrentTime ) )
                                  
                                 Ended up working my way to this and it looks how it should. Thanks guys for the help!