Questions tagged [date-format]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
77 views

Correct format to receive datatime data from consumer

I am working on a service in a sprint boot microservice application. The consumer for my service can be another service, as well as a UI component. The are 5 entities in my service, each entity having ...
user avatar
  • 143
1 vote
1 answer
91 views

How to manage 2 libraries that do mostly the same things in a project?

I am encountering a design problem on a new project. I have chosen the library Luxon (https://moment.github.io/luxon/) because I think it suits this project perfectly. Date-fns (https://date-fns.org/) ...
user avatar
-2 votes
4 answers
239 views

Is Date a String or a complex object?

It is my first post here and I thought it really fits on this side than on the regular website. I am sure many of you (programmers) must have had nightmares with this Date 'object', either in your ...
user avatar
128 votes
14 answers
40k views

Is there any technical reason why, in programming, the default date format is YYYYMMDD and not something else?

Is there any engineering reason why is it like that? I was wondering in the case of a RDBMS that it had something to do with performance, since a "YEAR" is more specific than a "MONTH", for instance: ...
user avatar
  • 1,351
1 vote
0 answers
114 views

Working with user timezones in the web browser and reports generated in the back-end

I have searched a lot on how to handle timezone in a web app. My application saves all dates as UTC in the database and returns UTC dates in json requests, so javascript proper handle conversions in ...
user avatar
-2 votes
1 answer
118 views

What is the preferable date-format used for designing APIs and storage

The date format should support different timezone and Daylight saving issues.
user avatar
  • 123
13 votes
4 answers
690 views

About my database date datatype crusade: Valid? Worthwhile? Does anyone else feel it?

I spend a lot of time answering SQL questions over on SO. I frequently come across queries of this ilk: SELECT * FROM person WHERE birthdate BETWEEN '01/01/2017' AND '01/03/2017' SELECT * FROM ...
user avatar
4 votes
3 answers
6k views

Working with timezones when storing dates in mysql

I have just a basic site with registration. With all other data, it stores the registration date in MySQL. If I'm in USA or in Canada, and I register at 2017-03-07 (Y-d-m), in MySQL it's 2017-04-07 ...
user avatar
  • 53
2 votes
1 answer
216 views

Optimal format for storing key/value data optimized for quick key lookup

For a completely fun project, I want to write a Markov chain chat bot. The algorithm used is quite simple - break down incoming sentences into tokens, storing what words tend to come after each token ...
user avatar
0 votes
1 answer
64 views

Historic (and prehistoric) dates in Ruby [closed]

In Ruby, is there a standard class or gem to work with dates that can be - but are not required to be - historical in nature? The dates have precision (to the nearest million years, decade, century, ...
user avatar
9 votes
1 answer
3k views

What is the difference between "kk" and "HH"+1 in ISO-8601?

In the ISO-8601 there are multiple hour formats, one of them is "kk" for hours 1-24. What is the purpose of this? Are there countries that offset their time? Is it for military usages? The ...
user avatar
  • 117
0 votes
2 answers
1k views

Dealing with date fields across browsers

I'm building a web application with multiple forms which all require date fields, and these fields need to be supported across IE, Chrome, and the like. Our application currently packages the output ...
user avatar
-1 votes
1 answer
14k views

Groovy date/time compare [closed]

I have this string got from JIRA as the date/time I need to compare which one is earlier:"21/Sep/12 2:01 PM". How can I do this in Groovy? Thanks Jirong
user avatar
0 votes
1 answer
33 views

standard format to describe opening schedules

I am working on a project in which I have to model opening schedules (eg a swimming pool is opened from 10:30am to 5pm on Tuesday from january to May. I try to fit this data in a csv and I started ...
user avatar
  • 7,822
1 vote
2 answers
2k views

how to deal with different formats of 'time/date format'?

Different systems accepts different formats of formating time. E.g. java, jquery: yyyy-MM-dd HH:mm some jquery plugins: yy-mm-dd HH:MM momentjs: YYYY-MM-DD HH:mm ISO-8601: YYYY-MM-DD hh:mm etc On ...
user avatar
0 votes
2 answers
379 views

Interpreting Date formats

Let's say I have a DatePicker control and I allow my US clients to type something like "1/1" in it and hit tab go to next control. So I will parse that date for them as "01/01/2014" and some more ...
user avatar
1 vote
3 answers
129 views

Checking a record is due based on the 'occuring' field

I have records that have dates against them and an occurring field that contains none,yearly and monthly id status note date last_updated occurring 1 open --- 01/01/2011 ...
user avatar
  • 109
2 votes
1 answer
170 views

Date & time - apply current, or 'then' DST?

I'm designing a function that given a UTC timestamp will convert it to the local time. The question I have, should the current times DST settings be applied to the conversion, or the timestamps DST ...
user avatar
133 votes
17 answers
15k views

How do you store "fuzzy dates" into a database?

This is a problem I've run into a few times. Imagine you have a record that you want to store into a database table. This table has a DateTime column called "date_created". This one particular record ...
7 votes
2 answers
3k views

Is a day really 24 hours long? [closed]

I asked this question on Stack Overflow and it was closed as off-topic. I'll ask it here hoping it will do better. This might sound silly, but bear with me. I've been working a lot with intervals and ...
user avatar
0 votes
2 answers
273 views

How to handle timezone for dates?

With a YYYY-MM-DD HH:MM:SS date I always store the UTC time. When I pull to display I translate timezones with built-in PHP functions and classes. I believe that is one correct way to do it and it ...
user avatar
  • 1,645
49 votes
3 answers
14k views

Why does Javascript treat days and months differently?

I've noticed that in JavaScript, when creating a Date, months are zero based, and days aren't. For example: var foo = new Date(2012, 1, 1) produces February 1st 2012 Why is this?
user avatar
  • 725
3 votes
3 answers
3k views

Date calculation algorithm

I'm working on a project to schedule a machine shop, basically I've got everything covered BUT date calculations, I've got a method called schedule (working on PHP here): public function schedule($...
user avatar
-1 votes
2 answers
381 views

Ideal "intermediate" file format to use for structured/styled text? [closed]

I have files that I want to make available in an variety of formats: HTML PDF EPUB Plain Text (maybe) Most of the files will be sourced in doc, docx, or rtf format, so that needs to be considered. ...
user avatar
13 votes
7 answers
7k views

Is there a constant for "end of time"?

For some systems, the time value 9999-12-31 is used as the "end of time" as the end of the time that the computer can calculate. But what if it changes? Wouldn't it be better to define this time as a ...
user avatar
3 votes
2 answers
207 views

Which timezone is used for permalinks of posts [closed]

I wanted to add timezone support to my blog app but got stuck with a design problem. Every post has a published_on field which stores the publication date in a timezone aware format (UTC converted to ...
user avatar
  • 149
0 votes
6 answers
259 views

International two-part date formats

Do people outside of the USA use two-part date abbreviations for the current year? For instance, representing the last day of May, you might see someone enter 5/31 into a date field. Do international ...
user avatar
  • 135
11 votes
3 answers
33k views

Should I use the Date type in JAX-RS @PathParam?

This is what I'm thinking about doing on a JEE Glassfish server using Jersey. @GET @Path("/{name}/{date}") public String getMessages(@PathParam("name") String name, @PathParam("date") Date date) I ...
user avatar
  • 494
6 votes
3 answers
3k views

Best representation for relative dates & durations

I use ISO 8601 to represent dates & durations and all is OK. But now I need to represent relative dates and durations like: The date for first day, at midnight, of the next week All the last ...
user avatar
  • 173
30 votes
12 answers
4k views

isn't number localization just unnecessary?

I've just read this page http://weblogs.asp.net/scottgu/archive/2010/06/10/jquery-globalization-plugin-from-microsoft.aspx One of the things they did was to convert the arabic date to the arabic ...
user avatar
  • 4,885
13 votes
11 answers
19k views

Is there a universal date format that anyone in the world can understand?

In Canada, everyone is familiar with the date format YYYY-MM-DD. In Europe or South Africa, they prefer DD-MM-YYYY. There are users from South Africa who get confused with the YYYY-MM-DD date format....
user avatar
  • 1,088