Showing
1 changed file
with
3 additions
and
1 deletions
| 1 | import { StringUtils } from './StringUtils'; | 1 | import { StringUtils } from './StringUtils'; |
| 2 | import getLunar from './GetLunar'; | 2 | import getLunar from './GetLunar'; |
| 3 | +import { systemDateTime } from '@kit.BasicServicesKit'; | ||
| 3 | 4 | ||
| 4 | /** | 5 | /** |
| 5 | * 日期/时间工具 | 6 | * 日期/时间工具 |
| @@ -436,7 +437,8 @@ export class DateTimeUtils { | @@ -436,7 +437,8 @@ export class DateTimeUtils { | ||
| 436 | * 获取文章发布时间 | 437 | * 获取文章发布时间 |
| 437 | * */ | 438 | * */ |
| 438 | public static getCommentTime(publishTime: number): string { | 439 | public static getCommentTime(publishTime: number): string { |
| 439 | - let currentTime: number = new Date().getTime(); | 440 | + // let currentTime: number = new Date().getTime(); |
| 441 | + let currentTime: number = systemDateTime.getTime(false); | ||
| 440 | let timeGap = currentTime - publishTime; | 442 | let timeGap = currentTime - publishTime; |
| 441 | let timeStr = "" | 443 | let timeStr = "" |
| 442 | if (timeGap >= 60 * 60 * 1000 * 48) { | 444 | if (timeGap >= 60 * 60 * 1000 * 48) { |
-
Please register or login to post a comment