For example: UTC+1.
In Joomla! we always handle dates and times in UTC+0 and apply time-zone offsets
when we come to display them.
This example uses the same time as the previous examples but in the UTC+1 time
zone. Adding the offset parameter corrects the time by removing 1 hour:
// ISO 8601 (UTC+1)
$date5 = new JDate('1925-01-30T01:00:00', 1);
Both RFC 2822 and ISO 8601 define a way in which we can include the offset within
a date and time string. If we pass a date and time that defines the offset and we pass
the second parameter, the second parameter will be ignored.
This RFC 2822 example is in CET (Central European Time), which has an offset of
plus 1 hour (if the optional time zone parameter were used, it would be ignored):
// RFC 2822 (CET)
$date5 = new JDate('Fri, 30 Jan 1925 01:00:00 CET');
This ISO 8601 example uses a numeric time zone designator of plus 1 hour (if the
optional time zone parameter were used, it would be ignored):
// ISO 8601
$date2 = new JDate('1925-01-30T00:00:00 +0100');
Utilities and Useful Classes
[ 342 ]
The JDate methods that we tend to use most commonly return the date and time in a
specific format.
Pages:
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473