vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   date changes (https://vborg.vbsupport.ru/showthread.php?t=68159)

garoboldy 08-09-2004 03:31 PM

date changes
 
I have this problem:

pulling a date from sql in this format 2004-04-12 0000:00:00

I trim it down to just the date and display as needed.

what I want to do is pull my latest information for past 5 days meaning as I run my query its going to get the date in the row change it to 2004-04-12 format without the time and see if its todays date or a date up to 5 days ago if it is then I want that information, if not then I dont.

this is going to be for a quick way to see my recent serice calls and what not that I use here at work.

if anyone has any ideas let me know, also if you need some code to see what exactly I have going on I will post on request.

Thanks

Colin F 08-09-2004 03:37 PM

Quote:

Originally Posted by garoboldy
I have this problem:

pulling a date from sql in this format 2004-04-12 0000:00:00

I trim it down to just the date and display as needed.

what I want to do is pull my latest information for past 5 days meaning as I run my query its going to get the date in the row change it to 2004-04-12 format without the time and see if its todays date or a date up to 5 days ago if it is then I want that information, if not then I dont.

this is going to be for a quick way to see my recent serice calls and what not that I use here at work.

if anyone has any ideas let me know, also if you need some code to see what exactly I have going on I will post on request.

Thanks

That might be a bit hard, as you're saving it as a string (I assume) meaning you can't order it by number...

Dean C 08-09-2004 03:51 PM

Well why anyone would store date/time in that format within a database is beyond me. The best thing to do would be to add a new column to that table. And make a script to change all the dates into a timestamp. Then it's much more easy to work with :)

garoboldy 08-20-2004 03:36 PM

yeah I got it fixed with the sbstr command and cut the string up the way I wanted it.


All times are GMT. The time now is 06:24 AM.

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.01108 seconds
  • Memory Usage 1,713KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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