DrupalBin
Submit Code
About
Recent Posts
Code
Fix for Fix for Code
Fix for Code
Code
Node type whitelist
an axe coach accessories
coach purses married
Fix for de las ghd alturas
de las ghd alturas
Code
more
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Log in using OpenID
Cancel OpenID login
Create new account
Request new password
Tags
CCK
drupal
fapi
jquery
menu
module
php
simpletest
taxonomy
test
theme
views
more tags
Home
date
Fix for Fix for Fix for Convert timezone from second in Drupal to WC3 standard.
December 23, 2011 - 10:10pm — Anonymous
// Convert timezone from second in Drupal to WC3 standard.
// Starts like: "-28800" and becomes: "-08:00"
$sec
=
substr
(
$val
,
1
)
;
$hours
=
intval
(
intval
(
$sec
)
/
3600
)
;
$minutes
=
intval
(
(
$sec
/
60
date
Read more
Fix for Fix for Convert timezone from second in Drupal to WC3 standard.
December 23, 2011 - 10:10pm — Anonymous
// Convert timezone from second in Drupal to WCstandard.
// Starts like: "-28800" and becomes: "-08:00"
$sec
=
substr
(
$val
,
1
)
;
$hours
=
intval
(
intval
(
$sec
)
/
3600
)
;
$minutes
=
intval
(
(
$sec
/
60
)
date
Read more
Fix for Convert timezone from second in Drupal to WC3 standard.
December 22, 2011 - 7:53pm —
doublejosh
// Convert timezone from second in Drupal to WC3 standard.
// Starts like: "-28800" and becomes: "-08:00"
$sec
=
substr
(
$val
,
1
)
;
$hours
=
intval
(
intval
(
$sec
)
/
3600
)
;
$minutes
=
intval
(
(
$sec
/
60
date
Read more
Even better, this function goes back and forth
December 22, 2011 - 7:51pm —
doublejosh
// Convert timezone from second in Drupal to WC3 standard, and back.
function
timezoneConvert
(
$val
,
$toSeconds
=
false
)
{
if
(
!
$toSeconds
)
{
// Starts like: "-28800" and becomes: "-08:00"
$se
date
Read more
Convert timezone from second in Drupal to WC3 standard.
December 22, 2011 - 7:19pm — Anonymous
// Convert timezone from second in Drupal to WC3 standard.
// Starts like: "-28800" and becomes: "-08:00"
$sec
=
substr
(
$val
,
1
)
;
$hours
=
intval
(
intval
(
$sec
)
/
3600
)
;
$minutes
=
intval
(
(
$sec
/
60
date
Read more
Fix for Fix for Fix for Incorrect Date due to timezone.
August 18, 2011 - 3:23am — Anonymous
//
The following code produces correct results
.
//
$datestamp
=
strtotime
(
$event_ref
->
field_event_date
[
0
]
[
'value'
]
)
;
//
$date
=
format_date
(
$datestamp
,
'custom'
,
'D d F Y'
)
;
$date
=
date
(
"D d
date
Timezone
Read more
Fix for Fix for Incorrect Date due to timezone.
August 18, 2011 - 3:23am — Anonymous
// The following code produces correct results.
//$datestamp = strtotime($event_ref->field_event_date[0]['value']);
//$date = format_date($datestamp, 'custom','D d F Y');
$date
=
date
(
"D d
date
Timezone
Read more
Fix for attempting to create a date_popup form element
May 30, 2011 - 5:24am — Anonymous
$form
[
'start_date'
]
=
array
(
'#type'
=
>
'date_popup'
,
'#title'
=
>
t
(
'Start Date'
)
,
'#date_timezone'
=
>
date_default_timezone_name
(
)
,
'#date_format'
=
>
'F j, Y'
,
'#date_increment'
=
>
1
,
'#d
date
date api
Form API
Read more
Fix for attempting to create a date_popup form element
April 22, 2011 - 8:20am — Anonymous
$form
[
'start_date'
]
=
array
(
'#type'
=
>
'date_popup'
,
'#title'
=
>
t
(
'Start Date'
)
,
'#date_timezone'
=
>
date_default_timezone_name
(
)
,
'#date_format'
=
>
'F j, Y'
,
'#date_increment'
=
>
1
,
'#d
date
date api
Form API
Read more
Fix for Incorrect Date due to timezone.
April 14, 2011 - 9:51pm —
JGonzalez
// The following code produces correct results.
//$datestamp = strtotime($event_ref->field_event_date[0]['value']);
//$date = format_date($datestamp, 'custom','D d F Y');
$date
=
date
(
"D d
date
Timezone
Read more
1
2
next ›
last »