close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Need to add 8 hours to a DATETIME

Thread began 4/01/2013 9:28 am by mrs | Last modified 4/02/2013 8:07 am by mrs | 4553 views | 8 replies

Christopher WestCommunity Expert

ok I just done experimenting as I never done this before. how about this code...
as a test copy thid directly:


<?php
$new_time = date(strtotime($_POST['fld_vLOCKDATE'])+60*60*8);
?>
<BR>
<?php echo date('l jS M Y H:i:s' ,$new_time); ?>

I tested the above code using a datime stored in a members table in my own database..this is the code I used:

<?php
$new_time = date(strtotime($row_rsMembers['MemberValidTo'])+60*60*8);
?>
<BR>
<?php echo date('l jS M Y H:i:s' ,$new_time); ?>

currently stored in the members table under MemberValidTo is 2013-04-02 00:00:00
the output of the above code I used gives me: Tuesday 2nd Apr 2013 08:00:00
(Which is +8 hours on the date stored in my database :)

So the above can be altered for your post variable.

Chris

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...