Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Piatok, 29. marec 2024
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  strftime() and date() display problem -> one day earlier

phpMyEdit General     strftime() and date() display problem -> one day earlier
Odoslať novú tému   Odpovedať na tému   Choď na stránku 1, 2  Ďalší  
 
rm     Založený: 30.01.2009   Príspevky: 2  
Príspevok Zaslal: 2009-01-30 19:10
Návrat hore  Odpovedať s citátom     

I wonder if anyone can provide any pointers as to why an underlying MySQL date should display in phpMyEdit with a "one day earlier" error ?

This only happens for some dates, and I have yet to establish whether the affected data was input via phpMyEdit or not.

This error can be seen using both of the following formatting settings :

'datemask' => 'D d/m/Y',

'strftimemask' => '%a %d/%m/%Y',

and for example will display an underlying database value of :

2009-04-04 as Fri 03/04/2009

Any help much appreciated.


Naposledy upravil rm dňa 2009-02-02 14:29, celkom upravené 1 krát

 
rm     Založený: 30.01.2009   Príspevky: 2  
Príspevok Zaslal: 2009-02-02 11:47
Návrat hore  Odpovedať s citátom     

I've done a bit of digging into this one, and have come up with a workaround by hacking the phpMyEdit class.

See the comments in the code, I would welcome any comment, confirmation, or denial on this problem.

Watch for wrap ....

===============================
function cellDisplay($k, $row, $css) /* {{{ */
{
$escape = isset($this->fdd[$k]['escape']) ? $this->fdd[$k]['escape'] : true;
$key_rec = $row['qf'.$this->key_num];
if (@$this->fdd[$k]['datemask']) {
/*
2009 02 02 Ronnie MacGregor bugfix
There seems to be a problem with datemask and strftimemask whereby for some dates
only, the date that is displayed is one day earlier than that stored in the table.
The calculated field appended with "_timestamp" is created in the function
get_SQL_column_list(), and uses the MySQL function UNIX_TIMESTAMP(). It may be that
this function is the root of the problem, and may involve the difference between
UTC and the local time zone ..... yet to be proven.
As a workaround, we can avoid the use of this calculated "_timestamp" field, and
simply prepare the field value for "date()" or "strftime()" processing by using
strtotime() on the field value.
*/
// $value = intval($row["qf$k".'_timestamp']); // Original line ///////////////////
$value = strtotime($row["qf$k"]); ////////////// Ronnie's line ///////////////////
$value = $value ? @date($this->fdd[$k]['datemask'], $value) : '';
} else if (@$this->fdd[$k]['strftimemask']) {
/*
2009 02 02 Ronnie MacGregor bugfix
There seems to be a problem with datemask and strftimemask whereby for some dates
only, the date that is displayed is one day earlier than that stored in the table.
The calculated field appended with "_timestamp" is created in the function
get_SQL_column_list(), and uses the MySQL function UNIX_TIMESTAMP(). It may be that
this function is the root of the problem, and may involve the difference between
UTC and the local time zone ..... yet to be proven.
As a workaround, we can avoid the use of this calculated "_timestamp" field, and
simply prepare the field value for "date()" or "strftime()" processing by using
strtotime() on the field value.
*/
// $value = intval($row["qf$k".'_timestamp']); // Original line ///////////////////
$value = strtotime($row["qf$k"]); ////////////// Ronnie's line ///////////////////
$value = $value ? @strftime($this->fdd[$k]['strftimemask'], $value) : '';

===============================

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2009-02-04 14:04
Návrat hore  Odpovedať s citátom     

It looks like PHP's strftime() function doesn't play well with Sun Solaris servers, in case that is the type of server you are using. There are also some notes at http://us.php.net/strftime about locale settings and various character sets (or lack thereof) which cause the reported problem.

 
bellalucy     Založený: 12.05.2020   Príspevky: 1  
Príspevok Zaslal: 2020-05-12 09:31
Návrat hore  Odpovedať s citátom     

If you are confused I'd say Mel should have cleared it up for you rather https://vaporhub.co.uk/shop/ nicely.It seems as if you are saying that since the US pre-emotively attacked Iraq to combat terrorism that the US deserves terrorist attacks

 
sanskaribhawnasingh     Založený: 09.06.2022   Príspevky: 13  
Príspevok Zaslal: 2022-06-29 07:50
Návrat hore  Odpovedať s citátom     

I like every one of your presents progress forward make for client I plans to site regulatory.

http://www.escortsghaziabad.org/location/abhay-khand-call-girls.html
http://www.escortsghaziabad.org/location/aerocity-call-girls.html
http://www.escortsghaziabad.org/location/ahinsa-khand-call-girls.html
http://www.escortsghaziabad.org/location/karol-bagh-call-girls.html
http://www.escortsghaziabad.org/location/vaibhav-khand-call-girls.html
http://www.escortsghaziabad.org/location/vaishali-call-girls.html

 
sanskaribhawnasingh     Založený: 09.06.2022   Príspevky: 13  
Príspevok Zaslal: 2022-06-29 07:52
Návrat hore  Odpovedať s citátom     

A commitment of appreciation is for the colossal information and scraps of information you have given here.

http://www.richaescorts.com/ludhiana-escorts-service.html
http://www.richaescorts.com/faridabad-escorts-service.html
http://www.richaescorts.com/gallery.html

 
james4545     Založený: 02.07.2022   Príspevky: 1  
Príspevok Zaslal: 2022-07-02 08:56
Návrat hore  Odpovedať s citátom     

Hi there I am sam, I am a blogger I have read a blog on the topic of vmug advantage discount code 2022 , do read my blog this blog is very knowledgeable and helpful so do read it once. Search engine optimization is the process of improving the quality and quantity of website traffic to a website or a web page from search engines. SEO targets unpaid traffic rather than direct traffic or paid traffic.

 
sanskaribhawnasingh     Založený: 09.06.2022   Príspevky: 13  
Príspevok Zaslal: 2022-07-07 13:07
Návrat hore  Odpovedať s citátom     

Remarkable information giving by your Article thank you for saving an edge to present to us such a good article. It has given a wide degree of novel examinations and procedures to manage the issues.

Indirapuram Escorts
About Indirapuram Escorts
Indirapuram Escorts Gallery
Indirapuram Escorts Links
Indirapuram Escorts Contact

 
Yashika     Založený: 22.06.2022   Príspevky: 22  
Príspevok Zaslal: 2022-08-25 07:16
Návrat hore  Odpovedať s citátom     

At present, the question hits up to the mind- why are many people still unsatisfied with their life? No one knows about it, even we don’t know because everyone has a specific reason for disappointment.

Call Girls in Indirapuram |
Indirapuram Escorts |
Escorts in Indirapuram |
Indirapuram Escorts Service |
Indirapuram Call Girls |
Call Girls in Indirapuram |

 
Yashika     Založený: 22.06.2022   Príspevky: 22  
Príspevok Zaslal: 2022-08-25 07:16
Návrat hore  Odpovedať s citátom     

Most are unhappy for personal reasons, so others might be quiet because they aren’t able to chat over their problems. We can’t fix the first mix-up, but we can easily fathom out the solution for the second. There are several ways to make you happy.

Escorts in Indirapuram |
Indirapuram Escorts Service |
Indirapuram Call Girls |
Call Girls in Indirapuram |
Indirapuram Escort |

 
Yashika     Založený: 22.06.2022   Príspevky: 22  
Príspevok Zaslal: 2022-09-01 14:11
Návrat hore  Odpovedať s citátom     

If you are looking for good call girls in Ghaziabad, then you have come to the right place, we can provide you call girls at a cheap and good rate, for this you can contact us on our web site or our number.

Ghaziabad Escorts Service
Ghaziabad Call Girls
Call Girls in Ghaziabad
Ghaziabad Escorts
Escorts in Ghaziabad

 
Yashika     Založený: 22.06.2022   Príspevky: 22  
Príspevok Zaslal: 2022-09-01 14:11
Návrat hore  Odpovedať s citátom     

If you are looking for good call girls in Ghaziabad, then you have come to the right place, we can provide you with call girls at a cheap and good rate, for this you can contact us on our web site or our number.

Ghaziabad Call Girls
Call Girls in Ghaziabad
Ghaziabad Escorts
Escorts in Ghaziabad
Ghaziabad Escorts Service

 
Yashika     Založený: 22.06.2022   Príspevky: 22  
Príspevok Zaslal: 2022-09-01 14:12
Návrat hore  Odpovedať s citátom     

Ghaziabad Call Girls are smart and sexy call girls who can also be funny when you press all the right buttons.

Call Girls in Ghaziabad
Ghaziabad Escorts
Escorts in Ghaziabad
Ghaziabad Escorts Service
Ghaziabad Call Girls

 
Yashika     Založený: 22.06.2022   Príspevky: 22  
Príspevok Zaslal: 2022-09-01 14:12
Návrat hore  Odpovedať s citátom     

We take the best care of clients when they take our escort service in Ghaziabad. With no flaw, we are the ones who can satiate your thirst making you highly excited and thrilled. Well, at the same time we do take high care about your security. We never disclose our clientele in front of anyone.

Ghaziabad Escorts
Escorts in Ghaziabad
Ghaziabad Escorts Service
Ghaziabad Call Girls
Call Girls in Ghaziabad

 
Yashika     Založený: 22.06.2022   Príspevky: 22  
Príspevok Zaslal: 2022-09-01 14:15
Návrat hore  Odpovedať s citátom     

Fear gets no chance to come to you when you entice us. We give you complete pleasurable moments with elegant babes and keeping the secrecy as to our top priority.
Escorts in Ghaziabad
Ghaziabad Escorts Service
Ghaziabad Call Girls
Call Girls in Ghaziabad
Ghaziabad Escorts

 
Odoslať novú tému   Odpovedať na tému   Choď na stránku 1, 2  Ďalší  

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov