• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: how to make hidden field date and hours

how to make hidden field date and hours 15 years 4 months ago #5342

how to make a hidden field which will contain day month year hour minute secound but in UNIX mode ?
with some scritp i guess ??
can anyone help me ?
The administrator has disabled public write access.

Re:how to make hidden field date and hours 15 years 4 months ago #5344

  • octavian
  • octavian's Avatar
  • NOW ONLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
Hello,

In the hidden field, setup the default value like this
//<code>
return time();
//</code>
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re:how to make hidden field date and hours 15 years 4 months ago #5355

but i need it in unix mode ? you know ..from 1970... all in secounds..
soemthink like this 1234234221
The administrator has disabled public write access.

Re:how to make hidden field date and hours 15 years 4 months ago #5427

  • octavian
  • octavian's Avatar
  • NOW ONLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
Hello,

The above code generates the exact unix format you require.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re:how to make hidden field date and hours 15 years 1 month ago #6437

  • covareo
  • covareo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
  • Thank you received: 2
For anyone needing to display other date or time formats:

I'm not sure if this is the best way to do this (I'm new to PHP) but this did the trick for a project I was working on. Please let me know if you have a better way to tackle this.

I created a hidden field and added the following to the Default Value field to return A US date/time stamp in m/d/yy hh:mm AM/PM:
//<code>
return date('n/j/y h:i A', time());
//</code>

For leading zeros in the date, seconds in the time and a timezone stamp try:
//<code>
return date('m/d/Y h:i:s A T', time());
//</code>

International Standard ISO 8601 date and time notation would be:
//<code>
return date('Y-m-d H:i:s', time());
//</code>

See here for more PHP date/time operators: http://us3.php.net/date
The administrator has disabled public write access.
The following user(s) said Thank You: kenneth.c.koppervik, am2781

Re:how to make hidden field date and hours 10 years 9 months ago #23529

Covareo,

Your post was very useful post. Thanks for taking the time to share.

Cheers,
John
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!