compare timestamps in javascript

I have a date saved in a string with this format: 2017-09-28T22:59:02.448804522Z this value is provided by a backend service. Now, in javascript how can I compare if that timestamp is greater than the current timestamp? I mean, I need to know if tha...
more »

2017-09-29 00:09 (4) Answers

Column date cannot be null

My code is throwing an error basically "Column 'Date' cannot be null" at mysql insertion time. I am using spring boot with mysql. I am trying to insert all the field from front end except MySQL date. I do not want user to enter date manually. I wan...
more »

2017-09-15 01:09 (0) Answers

Saving two or more dates in the same data object

I send date data (which comes from a CalendarView object) to the second activity. This is the first activity: String date = year + "/" + month + "/" + day; intent=new Intent(Main3Activity.this,MainActivity.class); intent.putExtra("date",date); I g...
more »

2017-09-14 11:09 (1) Answers

How to sort list of objects like array

I have a list of JSON objects. In each object, there is a unix timestamp field which is what I want to sort with. So I wrote a sorting function function sortUnixTimestamp(a, b){ var a = parseInt(a.timestamp); var b = parseInt(b.timestamp); ret...
more »

2017-08-29 19:08 (2) Answers

How to convert timestamp string to epoch time?

I have time stamp in format 2017-18-08 11:45:30.345. I want to convert it to epoch time, so I am doing below: String timeDateStr = "2017-18-08 11:45:30.345"; DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-dd-MM HH:mm:ss.SSS"); ZonedD...
more »

2017-08-18 14:08 (5) Answers

php calculates wrong date

The following code date_default_timezone_set('Europe/Berlin'); $timestamp = strtotime('13.03.2017'); echo $timestamp.' '.date('d.m.Y H:i:s', $timestamp).'<br>'; $timestamp += 7*24*60*60; echo $timestamp.' '.date('d.m.Y H:i:s', $timestamp).'<...
more »

2017-08-02 14:08 (0) Answers

How to get a TimeZone ID from a TimeStamp Value

Is it possible to get a TimeZone ID from a certain TimeStamp ? If it is please explain by a simple code. private String getDate(long timeStamp) {DateFormat objFormatter = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); TimeZone timeZone = TimeZone...
more »

2017-07-31 03:07 (2) Answers

Formatting Dates with non-standard format

I'm relatively new to this site so forgive me if my question is a bit vague for you guys. I also realize there are many threads on this topic, yet I feel they do not answer my question specifically since they are almost all about changing yy/mm/dd to...
more »

2017-07-24 14:07 (1) Answers

long timestamp to LocalDateTime

I have a long timestamp 1499070300 (equivalent to Mon, 03 Jul 2017 16:25:00 +0800) but when I convert it to LocalDateTime I get 1970-01-18T16:24:30.300 Here's my code long test_timestamp = 1499070300; LocalDateTime triggerTime = L...
more »

2017-07-03 12:07 (4) Answers

Getting timestamp to date and time

I have a timestamp column in my db. I need to convert timestamp in to date and time respectively. I use $timestamp = strtotime($row1['timestamp']); $date = date('d-m-Y', $timestamp); $time = date('Gi.s', $timestamp); When I use this code, I am n...
more »

2017-06-28 06:06 (2) Answers

first and last value of a Day in Pandas (Python)

I have a long period of data (3 Month), which was logged every 15 seconds. The first Timestamp looks like this: 2017-04-01 00:00:00 The lastTimestamp looks like this: 2017-04-01 23:59:45 Now i am looking for a way to get the first and the last valu...
more »

2017-06-24 17:06 (1) Answers