php 101 DateTime using atom format -
i'm trying use datetime class output current time in datetime::atom format.
i'm not sure if i'm using correctly. or have import library or maybe turn on wamp php module.
i'm getting "syntax error, unexpected t_new" error
here code:
<?php function d() { $df = new datetime(datetime::atom); echo $df; }
?>
you'd use datetime
this:
$time = new datetime; echo $time->format(datetime::atom);
the constructor (new datetime
) expects time want create object for, format doesn't matter @ point. specify format when outputting time.
having said that, error you're getting seems pretty unrelated , may not have specific line.
Comments
Post a Comment