123456789101112131415161718 |
- ///
- /// Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
- ///
- /// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
- /// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
- /// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
- /// This notice may not be removed from this file.
- class CPDFDateUtil {
- static String format(int milliseconds) {
- DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(milliseconds);
- return '${dateTime.year}-${_format(dateTime.month)}-${_format(dateTime.day)} ${_format(dateTime.hour)}:${_format(dateTime.minute)}:${_format(dateTime.second)}';
- }
- static String _format(int time) {
- return time < 10 ? '0$time' : '$time';
- }
- }
|