I have few cells where I fill date,and later I use these for calculations(substractions),so tell me which date format is good to use here. That should work for all regional languages and for all date separations like "-","/",".".Example - 12.1.2013.
I tried with -
//Format and Formatdatetime functions
Suggest me some answers please.
Thanks.
For universal dates I'd recommend one of three in order of my preference:
01-FEB-2013, as a format dd-mmm-yyyy
20130201, as format yyyymmdd
01022013, as a format ddmmyyyy
Related
I have a text value that looks like this: 2019-03-25T06:05:00-07:00. The general format is yyyy-mm-ddThh:mm:ss-GMT. I don't care about the GMT part. I am trying to use this text field to make time series scatter plots in excel.
I want to convert it to a timestamp as simply as possible. I currently do this using a bunch of formulas:
Input: 2019-03-25T06:05:00-07:00
Extract parts of time individually: =value(mid(input_cell,12,2))
Use date() and time() to get timestamp types
Add them together per this answer: https://stackoverflow.com/a/41164517/11163122
Use custom formatting to get a timestamp value
Output: 3/25/2019 6:05:00 AM
In total this took me 8 cells and custom formatting. This is too complicated. What is a simpler/more elegant way to do this?
You can use:
=--REPLACE(LEFT(A1,19),11,1," ")
and format as desired
Turns out the timestamp type is ISO 8601: https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations
This led me to this answer: https://stackoverflow.com/a/26315881/11163122
Using the formula there, I found this to be a sufficient solution. If anyone out there has a better method, please speak up! :)
I'm working with a date and time format from the Dukascopy csv download format. It looks like this:
01.03.2018 07:00:00.000 GMT-0000.
Is there a formula to convert this to a format that could be sorted chronologically? I don't need the -0000, just the date and time. Thank you.
Please try:
=DATE(MID(A1,7,4),MID(A1,4,2),MID(A1,1,2))+TIMEVALUE(MID(A1,12,12))
with formatting to suit.
Switch around the second and third parameters of DATE (the 4 and the 1) to suit the date convention of your source, if required.
try this:
=--SUBSTITUTE(LEFT(A1,20),".","/")
Then format as desired.
This only works if the input and the local settings agree as to order of MM/DD or DD/MM.
How can we convert YYYYWWD format date into normal date format YYYY-MM-DD using Syncsort?
I think you are out of luck. Syncsort has the same features as DF/Sort and according to this - https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.2.0/com.ibm.zos.v2r2.icea100/ice2ca_DFSORT_data_formats.htm - Df/sort does not recognise a YYYYWWD date format. It may be possible however to so the maths yourself with Syncsort, but I can;t see any way to do this.
YYYYWWD is a non-standard date format, so this is not really surprising. The best solution (if you cannot get the data in the correct format initially) would be to process the data with REXX before sorting it, if the volumes of data allows this.
Unless, of course, this is a 'homework' question and you have to use Syncsort? (which would imply that it is possible)
I have a excel 2010 spreadsheet with a column that has numbers which represent a specific date in the following format 021602, but I need to convert it to 02/16/2002.
First convert your string to a good looking date, then use the datevalue function to turn it into an actual date.
=datevalue(left(a1,2)&"/"&mid(a1,3,2)&"/"&right(a1,2))
021602 is not a number, inside Excel, it is probably a string.
datevalue(), as it has already been pointed out, is region-depedent.
text() returns a string, but returning a date is usually a better practice.
if the input is K7, then:
=DATE(RIGHT(K7,2)+2000,MID(K7,LEN(K7)-3,2),LEFT(K7,2-6+LEN(K7)))
=text(date(right(a1,2),mid(a1,3,2),left(a1,2)),"mm/dd/yyyy")
Datevalue depends on your system date setting. If your system is set to UK date format, you'll not be able to convert it successfully.
I am looking for a non-ugly way to convert a MUMPS formatted $H ("63868,62327" is 11/12/2015 at 17:18:47) date/time into an Excel 2016 compatible format date/time format. I came up with the following, but it's ugly:
=NUMBERVALUE(NUMBERVALUE(LEFT(A1,(SEARCH(",",A1)-1))-21548) & MID(NUMBERVALUE((1/86400)*MID(A1,(SEARCH(",",A1)+1),5)),2,6))
While this does work, it is definitely ugly. Any ideas?
How about:
=LEFT(A1,FIND(",",A1)-1)-21548+ MID(A1,FIND(",",A1)+1,99)/86400
Just curious to know if you are able to use $zdt($h) instead of $h on the Caché side. This will do that exact same conversion for you.
Furthermore, if this is a solution, then there are extra parameters to specify the format. The one you asked about is the default: $zdt($h,1,1) or simply $zdt($h).
$zdt has date formats between 1-15 and time formats between 1-10.
This format is as follows:
$zdt([n],[d],[t])
Where n is a mumps formatted number, d is the date format 1-15 and t is the time format 1-10.