Questions tagged [date-conversion]
Conversion of dates from one calendar or notation to another, for example, converting Julian calendar February 29, 1700 to Gregorian calendar March 11, 1700, or "March 11, 1700" to "1700-03-11".
653
questions
0
votes
0
answers
42
views
Convert string (nvarchar2) datatype 'timestamp' column to date in Oracle
I have an Oracle table column named 'timestamp' with 'nvarchar2' datatype
eg. ('-144041977')
Need to convert the above to any applicable/readable date format.
Any help appreciated / Thanks
-1
votes
5
answers
72
views
Subtracting days from a future date
$tour_date = '11 December 2022';
$newdate = date('j F, Y', strtotime('-10 day', strtotime($tour_date)));
echo "Make payment until $newdate";
It is working as expected. $newdate prints as 1 ...
-3
votes
1
answer
58
views
Convert French Date to English Date C#
I have object that contains french date and i want to vert it to english date
Exp: from 21/01/1990 00:00:00 to 1990-01-21 00:00:00
This my code to convert the date but didn't work because the output ...
-1
votes
1
answer
78
views
Date format in SQL server mm/dd/yyyy
My date format is 'dd/mm/yyyy' and I want to change it in 'mm/dd/yyyy' format.
I tried below query-
Select convert(nvarchar,creation_date,101)
but it is still showing old format.
1
vote
1
answer
40
views
Python coding for date conversion
My requirement is, I have a csv file which has multiple date columns. I am reading this CSV data file from AWS S3 bucket and need to load to Postgres DB table.
Before loading to DB, i need to convert ...
-2
votes
1
answer
62
views
Date to Timestamp with UTC in Java
I have to convert a date (that is already in UTC) to a java.sql.Timestamp.
Issue
But when doing that, the time is changed to machine time:
new Timestamp(date.getTime());
So I get another date on the ...
0
votes
2
answers
44
views
STRING to DATETIME Conversion in BIGQUERY
How to convert '29-JUN-2022 05:56:31:653000000 AM' the string value into BIGQUERY DATETIME/TIMESTAMP.
I was to PARSE it when millisecond part had . instead of : .
0
votes
1
answer
25
views
R: how to impute the NA with the specific date linked with other column
I need to impute the NA with the date associated with conversion 1, grouped by each user (USERID).
For the date without a conversion (1) linked with it, impute NULL to it.
Here is the table to show ...
-2
votes
1
answer
48
views
Convert string time with offset from UTC to UTC unix
How to convert string time with offset from UTC to UTC unix?
0
votes
2
answers
59
views
Get CST date in linux shell [duplicate]
I am trying to get the current date in CST format in linux.
todaysDate=$(date +%Y-%m-%d-%H:%M:%S);
echo 'todaysDate: '${todaysDate};
Result: todaysDate: 2022-06-03-09:15:42
is giving me time in UTC....
0
votes
0
answers
18
views
DateTime Conversions Issue
My table in the DB has the following format yyyy-mm-dd HH:MM:SS. but the required format for a varchar data type is dd-mm-yyyy HH:MM:SS. when I change this in the query below the code runs but it ...
0
votes
3
answers
152
views
How to convert a column value which is like 20220401 of number datatype to 2022-04-01 in snowflake
I have a column of number data type in snowflake that stores values like 20220401, now I need to convert it into date format. Could someone please help
1
vote
1
answer
108
views
Converting 6-digit Julian date to std date
I have 6-digit Julian dates from DB table, and I am trying to convert them to std date. I get error as the format is not correct. fmt = '%y%m%j'
This is the function I have written:
import datetime
...
1
vote
1
answer
88
views
Convert timestamp to date ColdFusion HQL SQL Server
Query example:
<cfquery name="jkgh" dbtype="hql">
SELECT COUNT(production_status_id)
FROM production s
where convert(varchar(10),s.production_end,111) =
'#dateformat(now(),&...
-1
votes
1
answer
61
views
How to convert user date to milliseconds [duplicate]
For now I'm using this long method to convert user input in format: DD.MM.YY HH:mm to milliseconds.
let day = date.substring(0, 2);
let mth = date.substring(3, 5);
let yr = date.substring(6, 10);
let ...
1
vote
0
answers
36
views
How work with Javascript Date timezone showing less a day
The application is based in Portugal whose timezone is UTC+00:00 but now is daylight saving.
Here I received a range of date values from the Datepicker component, which was '01/04/2022 - 01/05/2022' ...
0
votes
3
answers
130
views
How to use Python to extract Date Info (Month day, year) from a string column in a Pandas Dataframe?
I am now doing a Python programming task on a data set of movie industry, from the Kaggle website dataset https://www.kaggle.com/datasets/danielgrijalvas/movies .
I imported the dataset into a Pandas ...
2
votes
2
answers
246
views
How to convert out of range epoch to datetime python?
We have a functionality where we want to convert epoch to datetime objects and format them as strings in python. Moreover, we also want to convert the out-of-range epochs as datetime and format them ...
1
vote
0
answers
29
views
Convert a column with a month number that does not match the date, date of month and year in Python
I have a column with a month number, which is not listed as a date so there are 2 errors with it that I want to correct:
The count of the column starts from the month in which the count started(March)...
0
votes
1
answer
33
views
Convert YYY-MM-DD to MON DD, YYYY in PostgreSQL
I am having difficulty converting dates in a column from YYYY-MM-DD to Mon DD, YYYY
I think I first need to reorganize the dates and then use a case when statement to specify 01 = Jan and so on? Is ...
0
votes
1
answer
32
views
Can't use zoo's as.yearmon properly, the transformed column has years showing up like 0086 instead of 1986
Hello and thanks for being here.
I'm trying to convert dates with as.yearmon but the results I'm getting are odd and I do not know how to fix this; I tried searching on here and on the offical package ...
1
vote
2
answers
60
views
VBA Excel: comparison of dates under different locale settings
I have a column in "dd-mm-yy hh:mm" format that formed as a result of some action on UserForm:
Dim ws as Worksheet
Set ws = Worksheets("Logs")
With ws
For i = 1 to Me.ListBox1....
0
votes
0
answers
80
views
Epoch to timeStamp without the timezone
I input the epoch 1635759368000 and want to convert to regular timestamp
select to_timestamp(1635759368000/1000)
Gives me an output of
2021-11-01 05:36:08.000 -0400
But I just want
2021-11-01 05:36:08....
0
votes
0
answers
177
views
Node js - Adjust date from local time zone to another time zone by keeping the date format
Similar questions around converting dates are already available, however my use case is a bit different.
I want to get the current date and the time zone from where the user (client side IOS/SWIFT) is ...
0
votes
1
answer
236
views
Converting epoch timestamp into a readable date [duplicate]
I'm retrieving a value which is supposed to be a epoch timestamp from a database and trying to convert it back to a date format to display it into a screen.
I can see that I'm retrieving the correct ...
0
votes
1
answer
31
views
Convert string to date in google big query
I have a string column which has date value in the below format
6/1/2020 12:00:00 AM
I want only the date part and convert the column to date
so when i use date_trunc and parse date like below it is ...
0
votes
0
answers
56
views
Zabbix table events column ns trivial question regarding value conversion
I am trying to calculate based on zabbix DB time diff between events. I see there is NS column that I could use in some way, but I do not know exactly how to translate it to human-readable data.
...
0
votes
0
answers
10
views
Python Pandas convert date column object type to date [duplicate]
i have a Dataframe with a column called Date of data type object with records that have format like Apr.-21 (month.-Year) and i would like it to convert to Date 2021-04-01 (day to be always 01) .
How ...
0
votes
2
answers
479
views
Extract month name and year from timestamp to same column
I have a timestamp in the format: July 13, 2020, 6:07 PM
I would like to only keep the month and the year for my records. Ideally in the format: July, 2020
I've attempted the following that creates a ...
0
votes
1
answer
144
views
JSF Conversion of a LocalDate keep getting me Exceptions
I have an xhtml page where you can enter your name, your birthdate, aswell as your gender.
My task is to convert the incoming String as a LocalDate to use it in a (JSF) validator to check if the ...
-2
votes
5
answers
68
views
Extract last day of the month from MMM(M)YYYY
How can I extract the last day of the month from dates like
DEC2009, APR2013, AUG2008, NOV2017, JUL2014 etc.
I've tried datepart, convert, cast, month, year and I keep getting in a mess with type ...
1
vote
1
answer
104
views
new DateTime is not working properly with the future date
I am trying to calculate the differences between 2 dates.
The first date is the reservation date, and the second date is the traveler's birthdate. Format of the $tour_day is 15 December, 202X
$date1 = ...
0
votes
0
answers
59
views
Databricks Data Type Conversion error double to decimal
In databricks while writing data to curated layer, see error - Failed to execute user defined function (Double => decimal(38,18)). Does anyone know if faced such issue and how to resolve it.
When ...
0
votes
0
answers
101
views
How to pass function parameters in a SQL query for cosmosDb
I'm trying to create a query to filter records that were expired more than 7 days ago, but having trouble passing a parameter into a function inside a SQL query for CosmosDb. So this is an example and ...
1
vote
0
answers
665
views
pd.to_datetime can't convert unix timestamp : ValueError: non convertible value Open Time with the unit 'ms'
Here's the dataframe:
0. 1514764800000
1. 1514765100000
2. 1514765400000
3. 1514765700000
4. 1514766000000
...
105286. 1577835300000
...
1
vote
2
answers
126
views
How to convert a D M Y HH:MM:SS string in Java to Julian Date?
I have some strings in Java that come in the format: Day Month Year Hour:Minute:Second
7 Jan 2010 23:00:00.000
4 Feb 2010 17:40:00.000
What is the easiest way to parse this string and convert the ...
1
vote
1
answer
411
views
cast column to_date with multiple date formats in original text column in postgresql
I have a table with a event_date text column with values following one of two date formats:
'YYYYMMDD'
'YYYY-MM-DD'
For example:
event_date: text
1991-04-01
2009-02-11
20010101
NULL
20020101
...
0
votes
2
answers
46
views
How to ONLY replace the next two characters
I am trying to reset a ISO time to local time, but I am having some trouble converting it.
Currently, I:
// incoming ISO date
let date = new Date('2021-11-08T20:31:23.746Z');
// 1. get timezone ...
0
votes
0
answers
43
views
how to change date format to just year and month but must stay as a date value not varchar, or char..?
I read other similar question where the answer is to use FORMAT(getdate(),'yyy-MM') or something similar. However the problem for me in using anything like this, is that it changes the date type to a ...
0
votes
1
answer
31
views
Convert a character column to dates in R
I am trying to convert a data column (x_date) that has this form "31.03.2013" (the class is "character") into Dates in the form of "2013-01-31"
I tried with the following ...
0
votes
4
answers
53
views
Fill in Date when only knowing startdate and continous hours? Pandas
I have a dataframe which is from a license log file. The log file logs only by continueous hours. In the header of the logfile is a startdate. So everytime the hour starts with 0 a new day should ...
0
votes
1
answer
248
views
How to converts the createdAt date from AWS to the day of the week [duplicate]
I am trying to extract the day of the week from the AWS createdAt date format.
For example, given this date format: 2021-10-20T17:05:26.758Z find the day of the week (ie. Wednesday, Monday...)
I am ...
1
vote
3
answers
887
views
DateTime.UtcNow.ToString("yyyy/MM/dd HH:mm:ss") gives different formats for different users
I assumed that ToString("yyyy/MM/dd HH:mm:ss") will force the string to be formatted with '/', but I can see that every device gets different formats. How can I force it to be saved with '/'...
0
votes
1
answer
214
views
Is there any function that easy converts MBox date format to Delphi TDateTime format?
MBox files, like Google Gmail export mailbox contains various types of data, among other things, the date of the mail message that interests me. The date of the message is in the format:
DayOfWeek, dd ...
0
votes
1
answer
225
views
How to convert string in format ("dd-M-yyyy kk:mm:ss z") to LocalDateTime of server in java? [duplicate]
I need to convert dates in this format = "dd-M-yyyy kk:mm:ss z" to LocalDateTime as per server time. So far, I've tried every approach I could find here and on other blogs, but none helped. ...
0
votes
2
answers
137
views
How do convert from MMM-YYYY to YYYY-MM-DD, setting DD to the last day of month in a data frame?
I have a similar question on date conversion using data frame.
My data frame has two date string columns, hiredate and end_date, having different date formats, DD-MMM-YYYYand MMM-YY, respectively.
The ...
0
votes
1
answer
113
views
How to consider Daylight Saving Time in Linux Ubantu using C#
I've a C# Program what needs to convert from EST to UTC. Following function works perfectly in Linux except the fact that it's adding an hour extra means rather than adding 4 hours, it's adding 5 ...
0
votes
2
answers
451
views
SimpleDateFormat("dd/MM/yy kk:mm") showing time as 24:30 instead of 00:30 [duplicate]
I have to convert the date from API in the 24-hour format but SimpleDateFormat("dd/MM/yy kk:mm") is showing 24:30 instead of 00:30.
I am receiving the date in this format: "2020-05-25 ...
0
votes
1
answer
202
views
Amazon Athena - Cannot convert variable character to date
Using Amazon Athena, I am working with a set of data stored as variable characters and would like to convert them to dates. There are two columns within a table that have dates: (1) action_date and (2)...
0
votes
1
answer
92
views
Convert date field from GCP to DataStudio
Google Cloud Platform.
This file contains a field with this format Saturday Jul 24 2021 02:00:00 GMT+0200 (heure d’été d’Europe centrale)
I would like to use this field for a report in ...