Skip to content

date problem  #8

@orwah

Description

@orwah

Hi
if date format are changed for xoops (which is usual for some language)
in xoops/language/global.php:
define('_DATESTRING', 'Y/m/d G:i:s');
define('_MEDIUMDATESTRING', 'Y/m/d G:i');
define('_SHORTDATESTRING', 'y/n/j');

if we edit a news item ,then it's publish_date go back to 1/1/1970 !

reason:
in submit.php
line 338
$publish_date = $_POST['publish_date'];
$pubdate = strtotime($publish_date['date']) + $publish_date['time'];

the date is saved in db in formated y/n/j mode , so when strtotime try to decode it , it fails and return default 1/1/1970

maybe something like
$publish_date = date_create_from_format($dateformat,$_POST['publish_date']);
or whatever

the only formate string work is m/d/Y
because
we show date fields as formated date string, but when we save it in db we must specify format string before saving it or use strtotime. or it will try to decode it using m/d/Y

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions