datetime field

Author Message

Carlos Revillo

Monday 30 January 2006 3:02:13 pm

hi. i'm working in a shared hosting. i'm in spain but shared hosting is in the usa. i use a datetime for one of my custom class, and i set "actual time" by default. but, as expected, actual time is taken from the server and not from my country. how can i "add eight hours" to that value?
I mean, when i create a new content object of this class at 23:00 in Spain, ez publish assigns to that datetime attribute the value [date] 17:00, and this is not what i want...

J-A Eberhard

Monday 30 January 2006 11:34:55 pm

You have to add the following line in index.php

if(date('T') != 'Europe/Madrid') putenv("TZ=Europe/Madrid");

just before this line

$scriptStartTime = microtime();

Open Source Solution Provider
Open-Net Ltd Switzerland
http://www.open-net.ch

Carlos Revillo

Tuesday 31 January 2006 1:47:28 am

Thanks!. I was looking for another way (searching in ini fields looking for a config option or things like that) but what you say works for me.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 03:42:24
Script start
Timing: Jan 31 2025 03:42:24
Module start 'layout'
Timing: Jan 31 2025 03:42:24
Module start 'content'
Timing: Jan 31 2025 03:42:24
Module end 'content'
Timing: Jan 31 2025 03:42:24
Script end

Main resources:

Total runtime0.0294 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 588.0000151.1953
Module start 'layout' 0.00520.0041 739.1953220.6406
Module start 'content' 0.00940.0182 959.8359997.8516
Module end 'content' 0.02760.0018 1,957.687529.9922
Script end 0.0294  1,987.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003010.0504140.0002
Check MTime0.00124.1240140.0001
Mysql Total
Database connection0.00082.689910.0008
Mysqli_queries0.00248.093330.0008
Looping result0.00000.043710.0000
Template Total0.00134.310.0013
Template load0.00103.386310.0010
Template processing0.00030.910110.0003
Override
Cache load0.00072.370110.0007
General
dbfile0.00196.311180.0002
String conversion0.00000.029240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs