Changeset 29741 for trunk/tools/czartool/MySQLDb.pm
- Timestamp:
- Nov 10, 2010, 9:59:34 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/tools/czartool/MySQLDb.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/czartool/MySQLDb.pm
r29686 r29741 64 64 return $self->{_dbHost}; 65 65 } 66 ########################################################################### 67 # 68 # Adds the provided interval to the provided time 66 67 ########################################################################### 68 # 69 # Returns a date formatted wit hthe current formatting 69 70 # 70 71 ########################################################################### … … 82 83 ########################################################################### 83 84 # 85 # Returns a full MySQL formatted date 86 # 87 ########################################################################### 88 sub getFullDate { 89 my ($self, $time) = @_; 90 91 my $query = $self->{_db}->prepare(<<SQL); 92 SELECT DATE_FORMAT('$time','%Y-%m-%d %H:%i:%s'); 93 SQL 94 $query->execute; 95 96 return scalar $query->fetchrow_array(); 97 } 98 99 ########################################################################### 100 # 84 101 # Adds the provided interval to the provided time 85 102 # … … 191 208 192 209 my $query = $self->{_db}->prepare(<<SQL); 193 SELECT '$time1' < '$time2';194 SQL 195 $query->execute; 196 197 return scalar $query->fetchrow_array();210 SELECT TIME_TO_SEC(TIMEDIFF('$time1', '$time2')); 211 SQL 212 $query->execute; 213 214 return (scalar $query->fetchrow_array() > 0) ? 0 : 1; 198 215 } 199 216
Note:
See TracChangeset
for help on using the changeset viewer.
