I am having trouble with datetime format. I used custom format in order to get my data to read as 01/02/2016 05:33:23. But instead it is reading as 42401 05:33:23.
Any ideas on how to get it to work?
Thanks
If you are simply wanting to set a range to this format just go into the Format option once the range is highlighted; then select "More Number Formats". At the bottom is a "Custom" option, in the entry box type the following:
dd/mm/yyyy hh:mm:ss
That should be the correct format setting.
Related
i was new about edit format excel data. i have problem with remove time(HH:MM:SS sss.ss) from my date data, and edit my value data to decimal format
i was planning make date > 15/05/2017
and waktu_eod_per_menit > 13,58
There a lot data for me to edit like that, i was have doing step normal formatting ( choice format cells, and choice the format i want) but the data didnt change.
Please help me about this
Thanks
I need to separate the date and time for a large list of data in Excel, the format is 12/23 1600 (i.e. 23 December 16:00).
I tried the function =DATE(YEAR(serial_number),MONTH(serial_number),DAY(serial_number)), but it couldn't read that format.
Could you please tell me how to do that without change the format?
This works for me as I see your data
=DATE(YEAR(TODAY()),LEFT(A2,2),MID(A2,4,2))
and
=TIME(INT(MID(A2,FIND(" ",A2)+1,9)/100),MOD(MID(A2,FIND(" ",A2)+1,9)/100,1)*100,0)
If the data is a string, AND IF your windows short date regional format is MDY, then try:
=DATEVALUE(LEFT(A1,FIND(" ",A1)-1))
If the data is a "real" date, formatted to appear as you show, then try:
=INT(A1)
In either case, be sure to format the result as you desire.
If your Windows regional settings are other than MDY, then you can use this more complex formula:
=DATE(YEAR(TODAY()), LEFT(A1,FIND("/",A1)-1),MID(LEFT(A1,FIND(" ",A1)-1),FIND("/",A1)+1,2))
For the time portion, you can try
=TIMEVALUE(REPLACE(RIGHT(A1,4),3,0,":"))
If the above does not work, then provide more information about exactly what is in the cell, your regional format, etc.
I Received excel data with following format
Date format YYYY-MM-DD+11:00 (Ex 2014-02-15+11:00 /2014-02-18+13:00)
Now I need to convert into this format
2014-02-18 HH:MM:SI
Please help me to do this
cheers
Just did a quick test. It's a little sloppy, but this formula will work. For the sake of argument, it assumes that the data you're trying to convert is in A1 of the current sheet, that it's all the same length, and that the format is "General":
=SUM(DATEVALUE(LEFT(A1,10)),TIMEVALUE(RIGHT(A1,5)))
Wherever you use the above formula, change the format to the Custom Format YYYY-MM-DD HH:MM:SI. I'm not sure what you're looking for with SI. I'm taking that literally. That custom format will display the seconds value and then the letter I. If you're looking for a different value, like milliseconds, then you can look that up. But if the data you're converting is in a "General" format, when you convert it, it won't have seconds or milliseconds, anyway. Those will all get converted to 00s.
I have an excel file, with a date column, but I want to convert the date column to
YY/MM/DD/Time
Ive been searching for 2 hours and no result yet.
This is my data:
Source Data: http://i.stack.imgur.com/75zbS.jpg
Expected Output: YY/MM/DD/Time
Can someone help me how I can do it? I want to insert it into postgresql and I want to change everything to compatible date format.
EDIT: I have tried Right Click -> Format cells -> date but it does not change anything!
Thanks
You could use this method and split the date and time into separate cells:
=DATE((LEFT(A1,4)),(MID(A1,5,2)),MID(A1,7,2))
=TIME(MID(A1,10,2),(MID(A1,12,2)),0)
Once your date value is in a format Excel can recognize, you can then change the formatting to whatever you'd like.
Or if you don't care to have the value in a recognizable date format, you can just get your desired formatting like this (will give you a string that looks like this: YY/MM/DD/Time):
=MID(A1,3,2)&"/"&MID(A1,5,2)&"/"&MID(A1,7,2)&"/"&MID(A1,10,4)
ISO 8601 format would be YYYY-MM-DD H24:MI:SS.
But you can set Postgres to accept various date styles by setting the datestyle setting. You can do that globally in postgresql.conf or temporarily for your session.
SET datestyle = SQL, DMY
For more exotic formats, you can create a temporary staging table, COPY to it and INSERT into your target table from there. Among others, you can use to_timestamp():
SELECT to_timestamp('13/10/14/17:33', 'YY/MM/DD/hh24:mi')
More info and example code in related answers like these:
Replacing whitespace with sed in a CSV (to use w/ postgres copy command)
How to bulk insert only new rows in PostreSQL
Your going to have to parse the date into four columns using fixed parsing.
Then reassemble the columns any way you want.
Just Google with excel parse columns fixed.
I have a program that gets input in the form of an excel which it reads by querying (select * into a dataset).
The excel is created by the customer.
The excel contains a date column.
The problem is, that when looking into the dataset, the date column format is sometimes like mm/dd/yyyy and sometimes dd/mm/yyyy. (1/25/1970) (25/1/1970)
I guess it depends on the locale on the machine which the excel was made.
How can my program know what is the date format in the excel?
Not sure whether your question is about output or input...
For output:
You did not mention the database type. But the rule is: make your dates the american way: mm/dd/yyyy. For Jet, I generally use Format(MyDate, ""\#dd\/mm\/yyyy\#"")
("\" is the escape character, it makes sure the next character is output "as is")
For input:
Try reading the cell format ? range("a1").NumberFormat
However on my PC, with French setup a date displayed as 15/2/2011 has a returned format = m/d/yyyy so little use here !