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
3
votes
3 answers

How to Convert Chrome Browser History Sqlite Timestamps with Osquery

As I understand, the Chrome browser uses the WebKit time format for timestamps within the browser history database. WebKit time is expressed as milliseconds since January, 1601. I've found numerous articles that seemingly have the answer to my…
3
votes
1 answer

pandas read_csv slow performance when using parse_dates

I have a CSV file with 58K rows of time-series data. The first column is the timestamp and it's all unique values. When I do pd.read_csv("data.csv"), it takes less than a second. But when I do pd.read_csv("data.csv", parse_dates=[0]) it takes more…
empz
  • 11,509
  • 16
  • 65
  • 106
3
votes
4 answers

How do I convert numeric value into hours and minutes depending upon the number of digits

I have a vector which contains the time of nearest half an hour x <- c(30,200,2200,2300) I need to convert this into output <- c(00:30,02:00,22:00,23:00). I am not able to convert the values which are less than 4 digits. Please suggest.…
R06
  • 47
  • 3
3
votes
2 answers

Convert between arbitrary timezones

I'm trying to find a simple yet robust way to convert time between arbitrary time zones. This: http://www.cpearson.com/excel/TimeZoneAndDaylightTime.aspx explains only how to convert betwen my (current) TZ and another TZ. Those two SO articles…
Alexander
  • 313
  • 3
  • 10
3
votes
3 answers

converting epoch to ZonedDateTime in Java

How to convert epoch like 1413225446.92000 to ZonedDateTime in java? The code given expects long value hence this will throw NumberFormatException for the value given above. ZonedDateTime.ofInstant(Instant.ofEpochMilli(Long.parseLong(dateInMillis)),…
Sajin Surendran
  • 248
  • 6
  • 17
3
votes
3 answers

Java 8 timezone conversion

I know there are similar questions like this, but I wasn't quite able to find the example similar to mine. I learned about LocalDateTime and ZonedDateTime but I don't know how to tell my ZonedDateTime what's assumed timezone of parsed date. I'm…
guest86
  • 2,894
  • 8
  • 49
  • 72
3
votes
2 answers

UTC to local time in millis using JodaTime

I am attempting to show transactions over a certain time period using Jodatime. Our server requires a start date and end date to be in UTC (which is probably obvious). Therefore any business logic around these is using DateTime object with the…
Daniel Wilson
  • 18,838
  • 12
  • 85
  • 135
3
votes
2 answers

How to covert AM/PM time format to hour format in angular 2

I have time like this '2:00 PM' and I want to get it like this '14:00'.Can anyone please help me.Thanks.
MMR
  • 2,869
  • 13
  • 56
  • 110
3
votes
1 answer

What is the best way to convert a org.joda.time.DateTime to a java.time.OffsetDateTime?

The following works, but it seems a little clumsy to convert the time to a long, and then an Instant as well as converting the timezone to a TimeZone and then a ZoneId. Is there a cleaner way to do this? java.time.Instant instant =…
Alex Spurling
  • 54,094
  • 23
  • 70
  • 76
3
votes
2 answers

fullcalendar confusion with UTC and local date

I do let fullcalendar initialize normally. So it represents current date. (Midnight->midnight, 1day, 1h slots) From some other datasource I get data with timestamps. The format is "YYYY-MM-DD HH:mm" (transmitted as a string, no timezone…
3
votes
2 answers

Whats the difference in these two ways to convert milliseconds to seconds?

First way: long mySeconds = milliseconds/ 1000; Second way: double mySeconds = milliseconds * 1e-3d; This calculation is finally used to determine index of an array, like this: int index = (int) ((someDoubleSeconds + mySeconds)/…
2
votes
2 answers

Convert 24 Hour Time in to 12 Hour Time in Java

I want to convert 24 Hour time into 12 Hour AM/PM time. e.g:- How to convert date 2012-03-20T22:30:00.000+05:30 to to 2012-03-20 10:30 PM?? I have extratced the date but its in 24 Hour time. I though used SimpleDateFormater but still for 12.30 it is…
suraj_fale
  • 978
  • 2
  • 21
  • 53
2
votes
3 answers

How to convert date to timestamp using Python?

I need to convert this result to timestamp: >>> print (datetime.date(2010, 1, 12) + datetime.timedelta(days = 3)) 2010-01-15 I need to compare the value with this timestamp: >>> datetime.datetime.now() 2011-10-24 10:43:43.371294 How can I achieve…
André
  • 24,706
  • 43
  • 121
  • 178
2
votes
1 answer

Java Date Time conversion, unit tests fails remotely

I've got a quarkus application where I'm converting a String timestamp with a GMT offset to Europe/Berlin time. For example this time: "2022-08-13 10:13:56.48382+03" I've got unit tests that runs completely fine locally but fails remotely in the…
bob
  • 198
  • 1
  • 10
2
votes
3 answers

How to Convert string time in 12-Hr format to integer then back

I want to convert a 12-hour format time into a string, add some minutes, then convert back to string. My user will be entering a time as a sting example 8:03 AM this time needs to converted into an integer with 9 minutes added to it then converted…