Changeset c27aed3
- Timestamp:
- Aug 25, 2005 9:07:18 PM (15 years ago)
- Branches:
- master
- Children:
- e0bfdff
- Parents:
- cdc6002
- git-author:
- jrandom <jrandom> (08/25/05 21:07:18)
- git-committer:
- zzz <zzz@…> (08/25/05 21:07:18)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/syndie/java/src/net/i2p/syndie/BlogManager.java
rcdc6002 rc27aed3 2 2 3 3 import java.io.*; 4 import java.text.*; 4 5 import java.util.*; 5 6 import net.i2p.I2PAppContext; … … 416 417 return "eep".equals(schema) || "i2p".equals(schema); 417 418 } 418 419 private final GregorianCalendar _cal = new GregorianCalendar(); 420 private long getDayBegin(long now) { 421 synchronized (_cal) { 422 _cal.setTimeInMillis(now); 423 _cal.set(Calendar.MILLISECOND, 0); 424 _cal.set(Calendar.SECOND, 0); 425 _cal.set(Calendar.MINUTE, 0); 426 _cal.set(Calendar.HOUR, 0); 427 _cal.set(Calendar.HOUR_OF_DAY, 0); 428 return _cal.getTimeInMillis(); 419 420 private final SimpleDateFormat _dateFormat = new SimpleDateFormat("yyyy/MM/dd", Locale.UK); 421 private final long getDayBegin(long now) { 422 synchronized (_dateFormat) { 423 try { 424 String str = _dateFormat.format(new Date(now)); 425 return _dateFormat.parse(str).getTime(); 426 } catch (ParseException pe) { 427 pe.printStackTrace(); 428 // wtf 429 return -1; 430 } 429 431 } 430 432 }
Note: See TracChangeset
for help on using the changeset viewer.