Welcome to Geeklog, Anonymous Friday, November 01 2024 @ 03:42 pm EDT

Geeklog Forums

date formatting?


tokyoahead

Anonymous
Hi,

what is the internal function to reformat a SQL-timestamp into a Long Date as the user set it?

thanks
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
You can try this:
Text Formatted Code

$displaydate = COM_getUserDateTimeFormat($unixtimestamp);
 


Geeklog components by PortalParts -- www.portalparts.com
 Quote

tokyoahead

Anonymous
I get an array as result?

Got it.

thanks!
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by tokyoahead: I get an array as result?

Yes.

Hint: The functions in lib-common.php and their parameters are documented ...

bye, Dirk
 Quote

tokyoahead

Anonymous
Thanks. This is however for unix-timestamps, not for SQL-Now()-Timestamps... what do you suggest to convert it fastest?

I would only know how to split it with substr...seems not an elegant way to me...
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by tokyoahead: This is however for unix-timestamps, not for SQL-Now()-Timestamps... what do you suggest to convert it fastest?

Change the SQL request to retrieve it as a Unix timestamp:
Text Formatted Code
SELECT ... UNIX_TIMESTAMP(date) as unixdate WHERE ...
 

Then use the above function on $A['unixdate'].

bye, Dirk
 Quote

tokyoahead

Anonymous
thanks!



I guess the final version of the FAQ-Plugin is done, unless some feature-requests come in...
 Quote

All times are EDT. The time is now 03:42 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content