Changeset 3142 for branches/1.2/bp-core/bp-core-templatetags.php
- Timestamp:
- 07/21/2010 07:33:39 PM (16 years ago)
- File:
-
- 1 edited
-
branches/1.2/bp-core/bp-core-templatetags.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-core/bp-core-templatetags.php
r3111 r3142 841 841 842 842 function bp_format_time( $time, $just_date = false ) { 843 $date = date( get_option('date_format'), $time ); 844 845 if ( !$just_date ) { 846 $date .= ' ' . __( 'at', 'buddypress' ) . date( ' ' . get_option('time_format'), $time ); 847 } 843 if ( !$time ) 844 return false; 845 846 // Get GMT offset from root blog 847 $root_blog_offset = get_blog_option( BP_ROOT_BLOG, 'gmt_offset' ); 848 849 // Calculate offset time 850 $time_offest = $time + ( $root_blog_offset * 3600 ); 851 852 // Current date (January 1, 2010) 853 $date = date( 'F j, Y ', $time_offest ); 854 855 // Current time (9:50pm) 856 $time = date( ' g:ia', $time_offest ); 857 858 // Should we show the time also? 859 if ( !$just_date ) 860 $date .= __( 'at', 'buddypress' ) . date( ' g:iA', $time_offest ); 848 861 849 862 return apply_filters( 'bp_format_time', $date );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)