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

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

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