- Timestamp:
- 01/11/09 23:20:07 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
fDate.php
r457 r476 Hide Line Numbers 3 3 * Represents a date as a value object 4 4 * 5 * @copyright Copyright (c) 2008 Will Bond5 * @copyright Copyright (c) 2008-2009 Will Bond 6 6 * @author Will Bond [wb] <will@flourishlib.com> 7 7 * @license http://flourishlib.com/license … … 10 10 * @link http://flourishlib.com/fDate 11 11 * 12 * @version 1.0.0b2 12 * @version 1.0.0b3 13 * @changes 1.0.0b3 Added support for CURRENT_TIMESTAMP and CURRENT_DATE SQL keywords [wb, 2009-01-11] 13 14 * @changes 1.0.0b2 Removed the adjustment amount check from ::adjust() [wb, 2008-12-31] 14 15 * @changes 1.0.0b The initial implementation [wb, 2008-02-10] … … 61 62 } elseif (is_numeric($date) && ctype_digit($date)) { 62 63 $timestamp = (int) $date; 64 } elseif (is_string($date) && in_array(strtoupper($date), array('CURRENT_TIMESTAMP', 'CURRENT_DATE'))) { 65 $timestamp = time(); 63 66 } else { 64 67 if (is_object($date) && is_callable(array($date, '__toString'))) { … … 284 287 285 288 /** 286 * Copyright (c) 2008 Will Bond <will@flourishlib.com>289 * Copyright (c) 2008-2009 Will Bond <will@flourishlib.com> 287 290 * 288 291 * Permission is hereby granted, free of charge, to any person obtaining a copy fTime.php
r457 r476 Hide Line Numbers 3 3 * Represents a time of day as a value object 4 4 * 5 * @copyright Copyright (c) 2008 Will Bond5 * @copyright Copyright (c) 2008-2009 Will Bond 6 6 * @author Will Bond [wb] <will@flourishlib.com> 7 7 * @license http://flourishlib.com/license … … 10 10 * @link http://flourishlib.com/fTime 11 11 * 12 * @version 1.0.0b2 12 * @version 1.0.0b3 13 * @changes 1.0.0b3 Added support for CURRENT_TIMESTAMP and CURRENT_TIME SQL keywords [wb, 2009-01-11] 13 14 * @changes 1.0.0b2 Removed the adjustment amount check from ::adjust() [wb, 2008-12-31] 14 15 * @changes 1.0.0b The initial implementation [wb, 2008-02-12] … … 61 62 } elseif (is_numeric($time) && ctype_digit($time)) { 62 63 $timestamp = (int) $time; 64 } elseif (is_string($time) && in_array(strtoupper($time), array('CURRENT_TIMESTAMP', 'CURRENT_TIME'))) { 65 $timestamp = time(); 63 66 } else { 64 67 if (is_object($time) && is_callable(array($time, '__toString'))) { … … 275 278 276 279 /** 277 * Copyright (c) 2008 Will Bond <will@flourishlib.com>280 * Copyright (c) 2008-2009 Will Bond <will@flourishlib.com> 278 281 * 279 282 * Permission is hereby granted, free of charge, to any person obtaining a copy fTimestamp.php
r451 r476 Hide Line Numbers 3 3 * Represents a date and time as a value object 4 4 * 5 * @copyright Copyright (c) 2008 Will Bond5 * @copyright Copyright (c) 2008-2009 Will Bond 6 6 * @author Will Bond [wb] <will@flourishlib.com> 7 7 * @license http://flourishlib.com/license … … 10 10 * @link http://flourishlib.com/fTimestamp 11 11 * 12 * @version 1.0.0b 13 * @changes 1.0.0b The initial implementation [wb, 2008-02-12] 12 * @version 1.0.0b2 13 * @changes 1.0.0b2 Added support for CURRENT_TIMESTAMP, CURRENT_DATE and CURRENT_TIME SQL keywords [wb, 2009-01-11] 14 * @changes 1.0.0b The initial implementation [wb, 2008-02-12] 14 15 */ 15 16 class fTimestamp … … 746 747 } elseif (is_numeric($datetime) && ctype_digit($datetime)) { 747 748 $timestamp = (int) $datetime; 749 } elseif (is_string($datetime) && in_array(strtoupper($datetime), array('CURRENT_TIMESTAMP', 'CURRENT_TIME'))) { 750 $timestamp = time(); 751 } elseif (is_string($datetime) && strtoupper($datetime) == 'CURRENT_DATE') { 752 $timestamp = strtotime(date('Y-m-d')); 748 753 } else { 749 754 if (is_object($datetime) && is_callable(array($datetime, '__toString'))) { … … 988 993 989 994 /** 990 * Copyright (c) 2008 Will Bond <will@flourishlib.com>995 * Copyright (c) 2008-2009 Will Bond <will@flourishlib.com> 991 996 * 992 997 * Permission is hereby granted, free of charge, to any person obtaining a copy
