Questions tagged [date-parsing]

Date-parsing refers to programming logic which reads one or more parameters, attempts to match it to a supported or specified date format, then returns the resulting Date if successful.

References

494 questions
2
votes
1 answer

Parse Date with Day and GMT to timestamp without timezone

I am using bootstrap date range picker and I am getting the input date from var startDate = $('#reportrange').data('daterangepicker').startDate._d; and the output will look like "Sun Mar 10 2012 05:50:34 GMT +0600" But I want the output as…
RKR
  • 657
  • 3
  • 13
  • 26
2
votes
8 answers

parse this type of date format in java?

what would be the easiest way to parse this date format below in java?: 2010-09-18T10:00:00.000+01:00 i read the DateFormat api in java and could not find a method that takes a string or even this type of date format as a paremeter to parse? When i…
Jono
  • 17,341
  • 48
  • 135
  • 217
2
votes
2 answers

SimpleDateFormat throws parse Exception for +0100

I am trying with two sets of date with date format : DateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss"); It works fine for the Date : Fri, 26 Aug 2016 13:55:34 +0000 Not for the Date : Tue, 06 Sep 2016 11:57:14 +0100 Throws…
Prasanna Anbazhagan
  • 1,693
  • 1
  • 20
  • 37
2
votes
1 answer

Parsing error while converting javascript datetime into C#

I am using kendo time picker to show time on the UI. The widget submits the time in the following format Mon May 16 2016 01:00:00 GMT-0500 (Central Daylight Time) I followed the article here to convert the datetime into .Net datetime object However…
LP13
  • 30,567
  • 53
  • 217
  • 400
2
votes
1 answer

/Date(long + 1000)/ format

does anyone know what type of date format is it, and how can I parse it properly to Date object? I get it from server in a Jason response. { "DateFirstListed":"\/Date(1438218663000+1000)\/" }
Alireza Sobhani
  • 769
  • 1
  • 8
  • 18
2
votes
1 answer

Basic date parsing usage with strftime in python

This is a simple question on usage of the date parsing symbols in strftime. Given dates in the following format: mydt = "25-06 01:02:03" Then my attempt at a proper parsing string is : DateFormat = '%d-%m %H:%M:%S' But apparently that is…
WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560
2
votes
1 answer

Parse arbitary date formats in Python (including rfc3164)

PHP has the amazing strtotime() function which takes pretty much anything and turns it into a time. I'm looking for something similar in Python? As an example of why: I'm parsing syslogs which have the dumbest format ever (aka rfc3164) which omits a…
artfulrobot
  • 20,637
  • 11
  • 55
  • 81
2
votes
2 answers

How to convert "hh mm a" format string to seconds in java

I have string "6:00 AM" i want to convert this string to seconds or milliseconds in java. Please suggest me standard way to convert this. seconds from midnight "00:00 am"
Sameer Kazi
  • 17,129
  • 2
  • 34
  • 46
2
votes
3 answers

DateTime: Require the user to enter a time component

Checking if a user input is a valid date or a valid "date + time" is easy: .NET provides DateTime.TryParse (and, in addition, VB.NET provides IsDate). Now, I want to check if the user entered a date including a time component. So, when using a…
Heinzi
  • 167,459
  • 57
  • 363
  • 519
2
votes
1 answer

Formatting dates with moment.js based on locale

I'm using moment-with-locales.min.js for date manipulation and I need to format as the user leaves the textboxes. Because locales are an issue, I'm trying to use moment to do the formatting. However, I'm running into a problem and I'm not sure if…
Metallicraft
  • 2,211
  • 5
  • 31
  • 52
2
votes
1 answer

Adding days to locale specific dates using moment.js

I'm trying to use moment-with-locales.min.js to add (or subtract) days to a locale specific date. What I have are textboxes which contain dates formatted to specific locales. When the user updates one, it resets all of the others adding a specified…
Metallicraft
  • 2,211
  • 5
  • 31
  • 52
2
votes
2 answers

Different dates when used new Date("2014 Aug 11") and new Date("2014-08-11") in Javascript

new Date("2014 Aug 11") gives Mon Aug 11 2014 00:00:00 GMT+0100 (GMT Daylight Time) which's correct, but new Date("2014-08-11") gives Mon Aug 11 2014 01:00:00 GMT+0100 (GMT Daylight Time). Why there's 1 hour difference in these 2 dates? I am trying…
santhudr
  • 45
  • 6
2
votes
2 answers

Date(String) parse error in Java

I am using the following lines of code to parse a String as a Date: String displayBirthday; ... java.util.Date ss1=new Date(displayBirthday); SimpleDateFormat formatter5=new SimpleDateFormat("yyyy-MM-dd"); displayBirthday =…
User3
  • 2,465
  • 8
  • 41
  • 84
2
votes
1 answer

Why does python parse dates differently on Ubuntu and MacOS?

I've got some code that inexplicably works differently on Ubuntu and MacOS compiles of the same python version. Any explanation or workaround would be welcome. First, the setup on Ubuntu Python. The machine is running in UTC. Using PST in the time…
Rob Fagen
  • 774
  • 1
  • 8
  • 24
2
votes
1 answer

python time string does not match format

def deadlines(t): '''shows pretty time to deadlines''' fmt = '%a %d %m %Y %I:%M %p %Z' dt = datetime.strptime( t , fmt ) print 'dt ', repr(dt) first = 'Sun 11 May 2014 05:00 PM PDT' deadlines(first) ValueError: time data 'Sun…
syntax
  • 585
  • 1
  • 6
  • 17