close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Need a simple date/time hidden field

Thread began 11/19/2009 11:45 am by ijk76319396 | Last modified 11/19/2009 2:06 pm by CraigR | 2113 views | 4 replies |

ijk76319396

Need a simple date/time hidden field

What is the easiest way to insert a hidden field for entry into PHP database that enters the current time and date according to MY local timezone. I am familiar with the 'current timestamp' function in PHP my admin, however this displays the date in a YEAR/DAY/MONTH format with 24 hour time. I want it to read much simpler as in Day, Month, Year 3PM(example)
so what do I need to do?

Sign in to reply to this post

CraigRBeta Tester

if you timestamp fulfils your need, but you just want it to be prettier visually, you can either...

format the date field within the SQL statement

OR

format the date field in PHP, eg

<?php echo date('d/m/Y',strtotime($row_recordset['datefield']));?>

you can extract just the day, month, year or whatever you want to display.

Sign in to reply to this post

neilo

That is the answer. If you want to further configure it for your timezone (or in any other way) check out OG's kb article:

17/

Sign in to reply to this post

ijk76319396

Originally Said By: CraigR
  <?php echo date('d/m/Y',strtotime($row_recordset['datefield']));?>  



This option shows me everything except for the time field. Any ideas why?

Sign in to reply to this post

CraigRBeta Tester

the posted string returns day/month/year

look at the link posted by neilo to get php to return what you need

eg for year only, try

echo date('Y',strtotime($row_recordset['date_field']))

Sign in to reply to this post

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...