The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 split DATE and TIME column

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
yaarash Posted - 08/25/2022 : 02:34:33 AM
I have data with a date and time column together and I want to separate them to a time column and date column separately.
How can I do that?

Ya'ara
3   L A T E S T    R E P L I E S    (Newest First)
snowli Posted - 08/25/2022 : 09:54:08 AM
Could you show how column A looks like?
If it's regular date and time display, set the column to Time should work.

Also if it's in regular date and time display, u can use
frac(date(A)). Column B is set as Time afterwards.

date(A) -- convert the string in column A into date (julian date)
frac() -- return the decimal part




If the display is not typical date and time, u will need to specify the display syntax as 2nd argument of date() function
E.g. frac(date(A, "yyyy/MM/dd HH:mm:ss"))


See the help document https://www.originlab.com/doc/LabTalk/ref/Date-func

Thanks, Snow
yaarash Posted - 08/25/2022 : 05:30:49 AM
Hi!
I don't need the date info, only the time.
the original properties of the column are "Text&Numeric" so when I try to change to "Time" it gives me an error massage: "the specified format does not match the data in the column."

Ya'ara
Cecilia_syy Posted - 08/25/2022 : 04:32:50 AM
Hi
I wonder in the new time column, do you still want the date info? If you want to keep value, then you can change display format in column Properties dialog.
If you do not want date info in time column, then you can add new Date column, then set f(x) to round(A), set display to date in properties dialog. Add new Time column, then set f(x) to A-round(A), set display to time in properties dialog. In the f(x), I assume the original data+time column is column A.

Thanks
Cecilia

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000