Jump to content
Wiki Home
EPrints Home
Bazaar
Files
Main menu
Main menu
move to sidebar
hide
Navigation
Front Page
EPrints 3 Manual
EPrints Training Course
EPrints Glossary
Installing EPrints
How-to Configure EPrints
EPrints 3.2+ API
EPrints 3 Reference
EPrints Plugins
Wiki
All categories
Recent changes
Main Page
Help
EPrints Documentation
Search
Search
Appearance
Log in
Request account
Personal tools
Log in
Request account
Pages for logged out editors
learn more
Contributions
Talk
Editing
IRStats Technical Documentation
(section)
Page
Discussion
British English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Date == A date object was implemented because there were some specific things that needed to be done with dates. ===Functions=== *new(date_hash) - Creates a new date object when passed a hash with the keys 'day', 'month' and 'year'. *validate() - If the date is not valid, it will be modified to a sensible value. E.G. if it's Feb 30th, it will be modified to Feb 29th or 28th, dependant on if it's a leap year. *set(part_name, int) - Sets part of the date ('year','month' or 'day') to a specific value. *decrement(period) - increments the date by a period ('day', 'week', 'month', 'quarter', 'year'). Calls the mod_date function, which does the muscle work. *increment(period) - decrements by calling mod_date. *part(part_name, style - Returns the day, month or year. For month, if style=='text', returns a three letter string, otherwise returns an integer. For year, if style=='short', returns the last two digits, otherwise returns all four. *difference(date_object) - returns the difference in days between itself and another date. *less_than(date_object) - compares itself to another date object. Returns 1 if it's less than it, otherwise returns 0. *greater_than(date_object) - compares itself to another date object. Returns 1 if it's greater than it, otherwise returns 0. *month_name() - returns the three letter string of the month. *render(format_string) - returns a date string. Format can be: **'short' - Calls render_abbreviated - returns a date like this: 05-Jul-77 **'numerical' (default) - Calls render_numerical - returns a date like this: 19770705 *clone - returns an new, identical date object.
Summary:
Please note that all contributions to EPrints Documentation may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
EPrints Documentation:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)