date
Resample time series in pandas to a weekly interval
You can pass anchored offsets to resample, among other options they cover this case. For example the weekly frequency from Monday: ts.resample(‘W-MON’)
VBScript How can I Format Date?
0 = vbGeneralDate – Default. Returns date: mm/dd/yy and time if specified: hh:mm:ss PM/AM. 1 = vbLongDate – Returns date: weekday, monthname, year 2 = vbShortDate – Returns date: mm/dd/yy 3 = vbLongTime – Returns time: hh:mm:ss PM/AM 4 = vbShortTime – Return time: hh:mm d=CDate(“2010-02-16 13:45”) document.write(FormatDateTime(d) & “<br />”) document.write(FormatDateTime(d,1) & “<br />”) … Read more
Getting current date in milliseconds (UTC) (NO use of strings)
This is an old question but for the sake of the new visitors here is THE CORRECT ANSWER: Date.now(); It returns the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC
Compare Date object with a TimeStamp in Java
tl;dr Use the modern java.time classes instead of those troublesome legacy date-time classes. myPreparedStatement.setObject( … , Instant.now() // Capture the current moment in UTC. ) Old Date-Time Classes Poorly Designed Put more bluntly, the java.sql.Timestamp/.Date/.Time classes are a hack, a bad hack. Like java.util.Date/.Calendar, they are the result of poor design choices. The java.sql types … Read more
Fuzzy date algorithm
There is a property in NSDateFormatter – “doesRelativeDateFormatting”. It appears only in 10.6/iOS4.0 and later but it will format a date into a relative date in the correct locale. From Apple’s Documentation: If a date formatter uses relative date formatting, where possible it replaces the date component of its output with a phrase—such as “today” … Read more