| The Red Matrix

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Pages
Functions
datetime.php File Reference

## Functions
| timezone_cmp ($a, $b)
| select_timezone ($current= 'America/Los_Angeles')
| field_timezone ($name='timezone', $label='', $current= 'America/Los_Angeles', $help)
| datetime_convert ($from= 'UTC', $to= 'UTC', $s= 'now', $fmt="Y-m-d H:i:s")
| dob ($dob)
| datesel ($format, $min, $max, $default, $id= 'datepicker')
| timesel ($format, $h, $m, $id='timepicker')
| datetimesel ($format, $min, $max, $default, $id= 'datetimepicker', $pickdate=true, $picktime=true, $minfrom= '', $maxfrom= '')
| relative_date ($posted_date, $format=null)
| age ($dob, $owner_tz= '', $viewer_tz= '')
| get_dim ($y, $m)
| get_first_dim ($y, $m)
| cal ($y=0, $m=0, $links=false, $class='')
| z_birthday ($dob, $tz, $format="Y-m-d H:i:s")
| update_birthdays ()

## Function Documentation

age | ( |  | $dob,
|  |  | $owner_tz = `''`,
|  |  | $viewer_tz = `''`
| ) |  |

Referenced by advanced_profile(), directory_content(), dirprofile_init(), local_dir_update(), profiles_content(), and zfinger_init().

cal | ( |  | $y = `0`,
|  |  | $m = `0`,
|  |  | $links = `false`,
|  |  | $class = `''`
| ) |  |

Referenced by events_content().

datesel | ( |  | $format,
|  |  | $min,
|  |  | $max,
|  |  | $default,
|  |  | $id = `'datepicker'`
| ) |  |

returns a date selector

Parameters

  $format | format string, e.g. 'ymd' or 'mdy'. Not currently supported
  $min | unix timestamp of minimum date
  $max | unix timestap of maximum date
  $default | unix timestamp of default date
  $id | id and name of datetimepicker (defaults to "datetimepicker")

Referenced by dob().

datetime_convert | ( |  | $from = `'UTC'`,
|  |  | $to = `'UTC'`,
|  |  | $s = `'now'`,
|  |  | $fmt = `"Y-m-d H:i:s"`
| ) |  |

Referenced by abook_toggle_flag(), account_verify_password(), advanced_profile(), age(), api_account_rate_limit_status(), api_date(), api_rss_extra(), atom_entry(), attach_delete(), attach_mkdir(), attach_store(), authenticate_success(), build_sync_packet(), cal(), channel_content(), channel_remove(), chat_message(), chatroom_create(), chatroom_enter(), chatsvc_content(), chatsvc_post(), Cache\clear(), comments_are_now_closed(), consume_feed(), conversation(), create_account(), create_identity(), RedMatrix\RedDAV\RedDirectory\createFile(), cronhooks_run(), delete_item_lowlevel(), deliver_run(), diaspora_asphoto(), diaspora_comment(), diaspora_conversation(), diaspora_message(), diaspora_post(), diaspora_profile(), diaspora_request(), diaspora_reshare(), diaspora_send_images(), diaspora_send_mail(), diaspora_send_status(), diaspora_transmit(), directory_run(), dirsearch_content(), discover_by_url(), discover_by_webbie(), dlogger(), editpost_content(), ev_compare(), event_store_event(), events_content(), events_post(), externals_run(), first_post_date(), fix_system_urls(), format_event_diaspora(), format_event_html(), fsuggest_post(), RedMatrix\RedDAV\RedBrowser\generateDirectoryIndex(), get_atom_elements(), get_birthdays(), get_events(), get_feed_for(), get_first_dim(), get_item_elements(), get_mail_elements(), get_profile_elements(), get_public_feed(), Item\get_template_data(), RedMatrix\RedDAV\RedFile\getLastModified(), RedMatrix\RedDAV\RedDirectory\getLastModified(), impel_init(), import_author_rss(), import_author_unknown(), import_directory_profile(), import_post(), import_site(), import_xchan(), invite_post(), item_post(), item_store(), item_store_update(), items_fetch(), like_content(), list_post_dates(), logger(), magic_init(), mail_content(), mail_post(), mail_store(), manage_content(), message_content(), network_content(), new_contact(), notification(), notifier_run(), onepoll_run(), openid_content(), p_init(), pagelist_widget(), photo_upload(), photos_post(), ping_init(), poco_load(), poller_run(), post_post(), posted_dates(), profile_photo_post(), profiles_content(), profiles_post(), prune_hub_reinstalls(), RedMatrix\RedDAV\RedFile\put(), dba_mysql\q(), dba_mysqli\q(), queue_run(), relative_date(), removeaccount_post(), removeme_post(), photo_driver\save(), send_message(), send_reg_approval_email(), Cache\set(), settings_post(), photo_driver\store(), sync_directories(), sync_locations(), tag_deliver(), update_birthdays(), update_directory_entry(), update_modtime(), update_queue_time(), verify_email_address(), webpages_content(), widget_archive(), xchan_store(), z_birthday(), zot_feed(), zot_process_message_request(), zot_process_response(), zot_refresh(), and zotfeed_init().

datetimesel | ( |  | $format,
|  |  | $min,
|  |  | $max,
|  |  | $default,
|  |  | $id = `'datetimepicker'`,
|  |  | $pickdate = `true`,
|  |  | $picktime = `true`,
|  |  | $minfrom = `''`,
|  |  | $maxfrom = `''`
| ) |  |

returns a datetime selector

Parameters

  $format | format string, e.g. 'ymd' or 'mdy'. Not currently supported
  $min | unix timestamp of minimum date
  $max | unix timestap of maximum date
  $default | unix timestamp of default date
  $id | id and name of datetimepicker (defaults to "datetimepicker")
  $pickdate | true to show date picker (default)
  $picktime | true to show time picker (default)
  $minfrom | set minimum date from picker with id $minfrom (none by default)
  $maxfrom | set maximum date from picker with id $maxfrom (none by default)

Referenced by datesel(), events_content(), and timesel().

dob | ( |  | $dob | ) |

Referenced by profiles_content().

field_timezone | ( |  | $name = `'timezone'`,
|  |  | $label = `''`,
|  |  | $current = `'America/Los_Angeles'`,
|  |  | $help
| ) |  |

Referenced by setup_content().

get_dim | ( |  | $y,
|  |  | $m
| ) |  |

Referenced by cal(), events_content(), list_post_dates(), and posted_dates().

get_first_dim | ( |  | $y,
|  |  | $m
| ) |  |

Referenced by cal().

relative_date | ( |  | $posted_date,
|  |  | $format = `null`
| ) |  |

Referenced by advanced_profile(), connedit_content(), conversation(), format_notification(), Item\get_template_data(), notifications_content(), notify_content(), and ping_init().

select_timezone | ( |  | $current = `'America/Los_Angeles'` | ) |

Referenced by field_timezone().

timesel | ( |  | $format,
|  |  | $h,
|  |  | $m,
|  |  | $id = `'timepicker'`
| ) |  |

returns a date selector

Parameters

  $format | format string, e.g. 'ymd' or 'mdy'. Not currently supported
  $h | already selected hour
  $m | already selected minute
  $id | id and name of datetimepicker (defaults to "timepicker")

timezone_cmp | ( |  | $a,
|  |  | $b
| ) |  |

update_birthdays | ( |  | ) |

Create a birthday event for any connections with a birthday in the next 1-2 weeks. Update the year so that we don't create another event until next year.

Referenced by poller_run().

z_birthday | ( |  | $dob,
|  |  | $tz,
|  |  | $format = `"Y-m-d H:i:s"`
| ) |  |

Return the next birthday, converted from the owner's timezone to UTC. This makes it globally portable. If the provided birthday lacks a month and or day, return an empty string. A missing year is acceptable.

Referenced by zfinger_init().