Questions tagged [datetime-conversion]

Use this tag for questions related to the Datetime conversion, i.e. manipulating the Datetime in such a way, that a new, different in format, Datetime is produced.

is used in its general meaning, and is usually used for questions related on how to convert a Datetime object in another, new and with a different format, Datetime object, usually for making two different programming platforms communicate.

For example, your application may produce Datetimes of a specific format, but your Database to accept another Datetime format, different from the one your application is using. In that case, a conversion form the application's format to the Database's format is needed.

316 questions
0
votes
1 answer

Convert these strings of GMT time/date to UTC time/date with moment.js

I have two strings which represent the date/time in Greenwich Mean Time (GMT) which I wish to convert to their Coordinated Universal Time (or UTC) equivalent. 2019-11-01 09:58 2019-10-01 08:58 For the first string the time should remain the same…
Holly
  • 7,462
  • 23
  • 86
  • 140
0
votes
0 answers

Trying to converte msqlite string date to java.sql.date

I've saved date to msqlite. When I retrieve it, it gives me this string "Fri Jul 12 13:16:33 GMT+00:00 2019". But, I can't get to convert it to java.sql.Date that I need... Any help is appreciated SQLiteDatabase db =…
0
votes
2 answers

Convert HH:MM:S to seconds int

I have two columns with the format YYYY-MM-DD HH:MM:SS When I do the difference between these two columns, my result has a format of the form HH:MM:SS I would like to convert this result into seconds. How can I make it? Example: 2019-06-15…
nolwww
  • 1,355
  • 1
  • 15
  • 33
0
votes
1 answer

String to DateTime convert during CV StreamReader (C#)

I got issue with convert string to date, during StreamReader: string line; StreamReader sr = new StreamReader(file.ToString()); while ((line = sr.ReadLine()) != null) { string col13 = line.Split(',')[13]; //"22/06/2014 00:00:00" } I have tried…
4est
  • 3,010
  • 6
  • 41
  • 63
0
votes
2 answers

How to get nanoseconds since epoch for string formatted time "2019-01-25 14:34:34.123456789" in java?

I am able to parse 2019-01-25 14:34:34.123456789 string and get the object of ZonedDateTime. Now, I want to get time in nanoseconds precision level since epoch from this ZonedDateTime object.
0
votes
1 answer

r - as.POSIXct returns unexpected NA (previous solutions don't apply to my case)

I have a dataset with 228 observations and, one of the three columns specifying "Date" is in the following form: 2 December 1999 4 November 1999 7 October 1999 ..... My aim is to convert it into this format: 1999-12-02 (yyyy-mm-dd). To do so, I…
Rollo99
  • 1,601
  • 7
  • 15
0
votes
1 answer

Conversion date from tweet in python

I have some problem to convert date in python. For example you can see on the csv file, at the index 0 for the column "created_date", I have the value "1550740786000". I would like the convert this date in a more "traditional form" I tried to use…
0
votes
2 answers

Convert milliseconds data to daily data by aggregating corresponding values

I need to aggregate the timestamp data from milliseconds to daily.. sample data: System_ID n_iter value Timestamp 1 xXXXXXXXxx 1 511 2010-05-01 03:29:37.21 2 xXXXXXXXxx 2 513 2010-05-01 03:52:07.56 3 xXXXXXXXxx 3 …
Coolsun
  • 189
  • 9
0
votes
2 answers

Android time conversion

i have done code below to change time from UTC to another time zone but code is showing only UTC time.Also after formatting to source time format it shows system time zone . private String setTimezone(String time){ sourceformatter = new…
RIK
  • 123
  • 1
  • 2
  • 13
0
votes
2 answers

Given hours and month and year, convert it to a time stamp in Spark scala

I have three columns - "Year","Month" and "Hour". I need inputs on converting this to a timestamp in spark scala. Example: my year is 2017, month is 11 and hour is 570, I need to convert this to a timestamp in Spark Scala. Any inputs on this will be…
0
votes
1 answer

Confusion regarding DateTime conversion in R

I am trying to convert a character string into a dateTime object in R Sample data: Following is the code that I am using for conversion sample$Tweet_Timestamp <- lapply(sample$Tweet_Timestamp, function(x) as.POSIXct(strptime(x, "%a %b %d %H:%M:%S…
0
votes
1 answer

How to make a categorical variable based on whether a time object falls between two other time objects

I am trying to create a new categorical variable that shows whether an observation Time falls between dawn and dusk times gathered from suncalc. For example. All three variables currently class character. I have tried both as.factor() and…
CSk9
  • 69
  • 3
0
votes
3 answers

UTC time in java?

How can I get UTC value in Java of any given time and date with the respective time-zone? Say for example my current time zone is Asia/Kolkata, now how can I get UTC value of say 1.00 am on 21/07/2018?
0
votes
1 answer

Converting float to timestamp in Postgresql using Peewee

I've got a hard time converting float column value into timestamp in Postgress. Actually, in SQL it looks like this: TIMESTAMP 'epoch' + "t1"."timestamp" * INTERVAL '1 second') at time zone 'UTC' Could you help me to express the same with the…
0
votes
1 answer

Converting PST to CST and EST not giving proper output

I am trying to create a proper conversion method for my app which will get the input as PST and can convert it to CST or EST and also support the daylight saving. Here is the problem. Check this below code and the output. I am simply converting my…
user2367130
  • 125
  • 1
  • 2
  • 10