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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 split DATE and TIME column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

yaarash

Israel
2 Posts

Posted - 08/25/2022 :  02:34:33 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Cecilia_syy

65 Posts

Posted - 08/25/2022 :  04:32:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

yaarash

Israel
2 Posts

Posted - 08/25/2022 :  05:30:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

snowli

USA
1398 Posts

Posted - 08/25/2022 :  09:54:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000