Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A <a href="http://joda-time.sourceforge.net/apidocs/org/joda/time/LocalDateTime.html" rel="nofollow"><code>LocalDateTime</code></a> represents a datetime <strong>without</strong> a time zone. </p> <p>By calling <code>toDateTime(DateTimeZone)</code> you enrich the <code>LocalDateTime</code> with the provided timezone to get a <a href="http://joda-time.sourceforge.net/apidocs/org/joda/time/DateTime.html" rel="nofollow"><code>DateTime</code></a> which has the same date and time as the original <code>LocalDateTime</code> but is associated with the provided timezone. Note that you do not convert when calling <code>toDateTime</code>, because the original local datetime does not have an associated timezone.</p> <p>On The server :</p> <ol> <li>The server local datetime is <code>Tue Dec 17 00:04:29 2013</code>. </li> <li>You associate a <code>UTC+08:00</code> timezone. </li> <li>With <code>toDate().toString()</code> this is converted to a representation in the default timezone <code>+08:00</code> (or <code>SGT</code>) which is <code>Tue Dec 17 00:04:29 SGT 2013</code>. The conversion is an identity because the associated timezone is <code>SGT</code>.</li> </ol> <p>On the user:</p> <ol> <li>The user has local datetime <code>Tue Dec 17 00:04:29 2013</code></li> <li>You associate a <code>UTC+07:00</code> timezone.</li> <li>With <code>toDate().toString()</code> you convert to representation in the default timezone <code>+08:00</code> (or <code>SGT</code>) so the time is <code>Tue Dec 17 01:04:29 SGT 2013</code>. There is a +1 hour time difference between Singapore and Jakarata and so it is 1 am in Singapore when it's midnight in Jakarta.</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload