1
timgno
Datetime mysql format
  • 2012/6/19 10:53

  • timgno

  • Module Developer

  • Posts: 1504

  • Since: 2007/6/21


Hi Staff!

Don't you think it's important to define a static variable in global.php to the date format in mysql?

See tutorial

2
Mamba
Re: Datetime mysql format
  • 2012/6/19 12:20

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


That looks interesting, so please submit a request on SourceForge, so we can keep track of it.

Core team will be the best to respond.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

3
timgno
Re: Datetime mysql format
  • 2012/6/19 12:25

  • timgno

  • Module Developer

  • Posts: 1504

  • Since: 2007/6/21


There was an error processing a request on SourceForge

4
timgno
Re: Datetime mysql format
  • 2012/6/19 12:44

  • timgno

  • Module Developer

  • Posts: 1504

  • Since: 2007/6/21


I'm sorry

I had not logged in

5
irmtfan
Re: Datetime mysql format
  • 2012/6/20 4:35

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


timgno:
I think the line in mysearch module is hardcoded and didnt use the xoops local functions.
$criteria->add(new Criteria("date_format(datesearch,'%X-%m-%d')"$date,'<='));


Xoops has a function for all output date/time called "formatTimestamp"
The main function is located at class/xoopslocal.php but local parties can define their own function in language/LOCAL_LANGUAGE/locale.php

in "formatTimestamp" function there is a line for formatting the mysql:
case 'mysql':
                
$datestring 'Y-m-d H:i:s';
                break;


I think local parties just can define a static variable for this part?
Or maybe i totally misunderstood you and you said something i didnt notice?

6
timgno
Re: Datetime mysql format
  • 2012/6/20 8:07

  • timgno

  • Module Developer

  • Posts: 1504

  • Since: 2007/6/21


take a look here for ideas

7
irmtfan
Re: Datetime mysql format
  • 2012/6/23 5:12

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Thank you for the link timgno.
Im not a coder so i dont think i got much from that.
I just think xoops should define new/expand the current XOOPS FUNCTIONS (just like that formatTimestamp) for all *NEW* date/time related php functions. Otherwise we have *very big* problems in non Gregorian calendars.
your advices would be much appreciated.

EDIT:
for example we have big problems with the routine input date/time php function "strtotime"
Now i had to HACK all core/modules that uses this function to adopt it with hegira calendar.
IMO the best/easy way is expanding this function in class/xoopslocal.php
Today i sent a feature request for it.
https://sourceforge.net/tracker/?func=detail&aid=3537303&group_id=41586&atid=430843

Login

Who's Online

154 user(s) are online (96 user(s) are browsing Support Forums)


Members: 0


Guests: 154


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits