What is the significance of January 1, 1601?

Because 1/1/1601 was the start of the epoch. Take it from Raymond Chen: Why is the Win32 epoch January 1, 1601?🕗 The FILETIME structure records time in the form of 100-nanosecond intervals since January 1, 1601. Why was that date chosen? The Gregorian calendar operates on a 400-year cycle, and 1601 is the first year … Read more

In an ISO 8601 date, is the T character mandatory?

It’s required unless the “partners in information interchange” agree to omit it. Quoting an earlier version of the ISO 8601 standard, section 4.3.2: The character [T] shall be used as time designator to indicate the start of the representation of the time of day component in these expressions. […] NOTE By mutual agreement of the … Read more

`uuuu` versus `yyyy` in `DateTimeFormatter` formatting pattern codes in Java?

Within the scope of java.time-package, we can say: It is safer to use “u” instead of “y” because DateTimeFormatter will otherwise insist on having an era in combination with “y” (= year-of-era). So using “u” would avoid some possible unexpected exceptions in strict formatting/parsing. See also this SO-post. Another minor thing which is improved by … Read more

Kendo grid date column not formatting

I found this piece of information and got it to work correctly. The data given to me was in string format so I needed to parse the string using kendo.parseDate before formatting it with kendo.toString. columns: [ { field: “FirstName”, title: “FIRST NAME” }, { field: “LastName”, title: “LAST NAME” }, { field: “DateOfBirth”, title: … Read more

Formatting a Date String in React Native

The beauty of the React Native is that it supports lots of JS libraries like Moment.js. Using moment.js would be a better/easier way to handle date/time instead coding from scratch just run this in the terminal (yarn add moment also works if using React’s built-in package manager): npm install moment –save And in your React … Read more

Is it always a good idea to store time in UTC or is this the case where storing in local time is better?

I think that in order to answer that question, we should think about the benefits of using UTC to store timestamps. I personally think that the main benefit to that is that the time is always (mostly) guaranteed to be consistent. In other words, whenever the timezone is changed, or DST applied, you don’t get … Read more

group by dates in mongodb

New answer using Mongo aggregation framework After this question was asked and answered, 10gen released Mongodb version 2.2 with an aggregation framework, which is now the better way to do this sort of query. This query is a little challenging because you want to group by date and the values stored are timestamps, so you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)