cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Sarah_Gagne
Level I

Convert Character Timestamp to Numeric Date

I've read through past discussion posts trying to find a solution to converting a timestamp that is character/nominal into a date that is numeric/ordinal. So far I've tried the following approaches without success:

  • Reimporting the .CSV with numeric/ordinal selected
  • Formula using informat and format
  • Recoding

Does anyone have a formula suggestion that I can use to transform 'Timestamp' into the format identified in 'Ideal Timestamp'?

2 REPLIES 2
jthi
Super User

Re: Convert Character Timestamp to Numeric Date

Use Word + In Format

In Format(Word(1, :Timestamp, " "), "YYYYMMDD")

jthi_1-1744730374526.png

You can also try to play around with Format Pattern but it might not work due to milliseconds. If you wish to have the time left, use word with "." separator and modify the format for informat as necessary

-Jarmo
txnelson
Super User

Re: Convert Character Timestamp to Numeric Date

Here is one way to handle this.

Create a numeric column and set the format to be displayed to

       yyyy-mm-dd

Then set the columns formula to

Date MDY(
	Num( Substr( :Timestamp, 5, 2 ) ),
	Num( Substr( :Timestamp, 7, 2 ) ),
	Num( Substr( :Timestamp, 1, 4 ) )
)

txnelson_0-1744730921230.png

 

Jim

Recommended Articles