Python convert date string from an UNKNOWN format - python-3.x

Noob here - sorry in advance. I have a large data set with dates in a variety of unknown formats. I need to convert those unknown date formats into a consistent format such as "M/D/YYYY".
All the samples I see require that you know the input format, which I do not. I found references to "dateutil" which may work, but I cannot find out how to add that to my WINDOWS environment. All I've seen is "use PIP" which is Greek to me and WINDOWS apparently.
Is there a function (DEF) out there that takes a date string in an unknown format and converts it to a date object that can be re-formatted consistently?
OR -
If dateutil will help me solve my problem is there a WINDOWS version and how do I install it and then reference it?
Please do not refer me to the following, it does not answer my question: Converting date string in unknown format to datetime
THANKS IN ADVANCE!

Related

Converting odd date format into actual date

I have general formatting coming across as 'Sep 30 2021'. How can I easily convert this to read 2021-09-01? I have attempted to do so the normal routes but it appears I need a formula to solve this issue. Any and all help is appreciated.
Generally you can do this by =Text(Column, "yyyy-mm-dd")

How to Properly read an excel with date format problems in R

I Have an excel file with blood sample results (i.e. Insuline and Glycemia).
The problem is that there are some cells on that excel file that have a wrong format, they have the insulin results as a personalized date format (d.m), therefore the result looks like 18.3 (which is reasonable) but when I try to read the file in R, it looks like a numeric date = 44273 (March 18th, 2021).
I've been trying to fix it at the excel file, but I haven't been able to do it. Does anybody has an idea of how to fix this problem?
Best Regards!
you could use package readxl and use the col_types argument to read in the column as numeric. Below would be reading 4th column as numeric:
library(readxl)
read_excel("blood_sample.xlsx", col_types = c("logical", "skip", "guess", "numeric"))
Read more here: https://readxl.tidyverse.org/articles/cell-and-column-types.html

Turn text with date to date type

I've searched on the internet and couldn't find. The only solution I found was to download kutools, and I can't do it.
I've made a macro that gets some values from an intranet, but I need the type of cell to be in date so I can work around it and filter it.
I don't know if I explained it correctly, and sorry if my english isn't the best.
I made an image to better explain it.
How it currently is / How I want it to be:
You can use the DATE and TIME functions to convert your text to date/time format.
=DATE(2018,MID(A2,4,2),LEFT(A2,2))+TIME(MID(A2,7,2),RIGHT(A2,2),0)
Using Filters:

Can't convert Date to Number

I have a userform and I take start and end dates from user as in dd.mm.yyyy format. To make it easier to compare dates, I want to turn it to a double or long type of value. I have tried as in below but it gives me an error of type mismatch.
endDate is already defined as Double and as you can see, Me.g_end.Value is string in proper format. Why do I get this error, and how can I handle it?
Also I need to add, DateValue(Me.g_end.Value) works fine with my friend to get value of date who uses Excel 2013. I use Excel 2016.
You need to enter dates in a valid format in order for Excel to recognize them as dates.
As far as I know, nowhere uses dots (periods) in dates. (As I recall, nowadays only one country in the world even recognizes dots as am official date separator.)
Click your Start menu and type Region to find and open Windows Region and Language Settings.
Note the format that your system is expecting for Short Date, including the symbol between each date part, and try entering your dates in Excel like that.

Convert date to string in impala

I have a column which is a date in the following format : 2018-04-28.
I try to convert it in Impala but it seems there is no way it lets me operate on it at all. I know it doesn't support date formats but it won't even let me convert it.
I've tried to use things like the following but nothing works :
SELECT unix_timestamp(cast(t1.`date` as string),'yyyy-MM-dd') FROM example
Even cast(t1.dateas string) won't work. I always get the same error :
AnalysisException: Unsupported type 'DATE' in 't1.`date`'.
Would anyone know a way to convert this ?
Thanks,
First use DATE_FORMAT to convert datetime
if you use impala please set your date-column type to timestamp impala support timestamp much well than date . the time stamp String format should be like yyyy-mm-dd hh:mm:ss
I tried your SQL it works well when change date to timeStamp
the date type might be a bug in impala.

Resources