vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Date Conversion (https://vborg.vbsupport.ru/showthread.php?t=26350)

Ryan Johnson 08-25-2001 02:14 AM

I converted the last 10 posts hack, so I could place it on an ASP page... The problem is, the date is in Unix time. I can't find any code anywhere to make the conversion. It seems like something like this is close, but it's definitely missing something:

CDate("01-01-1970") + (1 / 24 / 60 / 60 * Unix_Date_Here)

Does anyone have the correct formula?

ToraTora! 08-25-2001 02:45 AM

<a href="http://www.php.net/manual/en/function.date.php" target="_blank">php.net/manual/en/function.date.php</a>

Ryan Johnson 08-25-2001 03:04 AM

Yes, thanks, but I need to do it without the use of any Perl/PHP functions...

ToraTora! 08-25-2001 03:42 AM

well, the unix time stamp is a tricky one to convert, however, if you look at my mood hack, it can be done very simply. I worked way to long on that little part to make it that simple, so i am not to inclined to give it away, but all you really need for a good push in the rite direction, is the link i just gave you.

Are you thinking of converting the time stamp using Java? Im not following why you wouldnt use the php standard, for a php hack, with anything else but php.....

Ryan Johnson 08-25-2001 04:04 AM

OK... I will work on writing it out. I was just hoping someone had already done the work and was willing to share.

I'm placing it on an ASP page.

Ryan Johnson 08-26-2001 02:13 AM

For anyone who may be wondering... this works:

CStr(CDate("01-01-1970" + (1 / 24 / 60 / 60 * dblUnixDate) - 7))

Replace dblUnixDate with the Unix Time Stamp.

Replace -7 with the time zone offset. The only thing I still have to do is dynamically change the offset for daylight savings. Any ideas?


All times are GMT. The time now is 05:35 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.01032 seconds
  • Memory Usage 1,709KB
  • 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)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