Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F557585
PhutilCalendarDateTime.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhutilCalendarDateTime.php
View Options
<?php
abstract
class
PhutilCalendarDateTime
extends
Phobject
{
private
$viewerTimezone
;
private
$isAllDay
=
false
;
public
function
setViewerTimezone
(
$viewer_timezone
)
{
$this
->
viewerTimezone
=
$viewer_timezone
;
return
$this
;
}
public
function
getViewerTimezone
()
{
return
$this
->
viewerTimezone
;
}
public
function
setIsAllDay
(
$is_all_day
)
{
$this
->
isAllDay
=
$is_all_day
;
return
$this
;
}
public
function
getIsAllDay
()
{
return
$this
->
isAllDay
;
}
public
function
getEpoch
()
{
$datetime
=
$this
->
newPHPDateTime
();
return
(
int
)
$datetime
->
format
(
'U'
);
}
public
function
getISO8601
()
{
$datetime
=
$this
->
newPHPDateTime
();
if
(
$this
->
getIsAllDay
())
{
return
$datetime
->
format
(
'Ymd'
);
}
else
if
(
$this
->
getTimezone
())
{
// With a timezone, the event occurs at a specific second universally.
// We return the UTC representation of that point in time.
$datetime
->
setTimezone
(
new
DateTimeZone
(
'UTC'
));
return
$datetime
->
format
(
'Ymd
\\
THis
\\
Z'
);
}
else
{
// With no timezone, events are "floating" and occur at local time.
// We return a representation without the "Z".
return
$datetime
->
format
(
'Ymd
\\
THis'
);
}
}
abstract
public
function
newPHPDateTimeZone
();
abstract
public
function
newPHPDateTime
();
abstract
public
function
newAbsoluteDateTime
();
abstract
public
function
getTimezone
();
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 8:30 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
111607
Default Alt Text
PhutilCalendarDateTime.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment