vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   date_format (https://vborg.vbsupport.ru/showthread.php?t=230351)

Ghostsuit 12-16-2009 10:30 PM

date_format
 
This is related to the PHP widget question I had

I have this code

Code:

SELECT date_format(gig.date, '%a %D %b %Y') AS gig_date,
returns

Code:

510025a 17th Dec 2009
Now that should return something like

Code:

Thurs 17th Dec 2009
Anyone ideas why it's not?

vaskies 12-17-2009 06:24 AM

Are you sure gig.date is a valid date? This might be useful: http://www.w3schools.com/SQL/func_date_format.asp Scroll to the bottom for examples. Otherwise I'd guess your error lies somewhere else in your code.

Ghostsuit 12-17-2009 11:05 AM

Yeah the gig.date is 2009-12-17 and the code works fine on vb3 but in vb4 it displays with the numbers at the start rather than the Day.

Something very odd happening.

--------------- Added 18 Dec 2009 at 10:54 ---------------

ok jsut realised that when you save the widget the

Code:

SELECT date_format(gig.date, '%a %D %b %Y')
gets changed to with out the spaces between % u0025 and a

Code:

SELECT date_format(gig.date, '% u0025 a %D %b %Y')
anyway to stop that or is it a bug?

Ghostsuit 12-21-2009 10:20 AM

For the record this was a bug in the PHP widget. vBulletin have it at confirmed pending so should be fixed after rc4.

Lynne 12-21-2009 02:14 PM

That's a weird one - good catch!

Ghostsuit 12-21-2009 02:42 PM

Yup very strange.


All times are GMT. The time now is 06:07 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01039 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete