Example Analysis of time Intermediate key in python
This article mainly introduces the example analysis of time middle key in python, which is very detailed and has certain reference value. Friends who are interested must finish it!
The arrangement of time middle keys
The following content is very useful for the time node processing method returned by the data interface.
Import {Pipe, PipeTransform} from'@ angular/core' @ Pipe ({name: 'interval'}) export class IntervalPipe implements PipeTransform {transform (value: any): any {let date = new Date (value) if (! date) {return'} let now = new Date () let year = now.getFullYear ()-date.getFullYear () if (year) {return year + 'years ago'} let month = now.getMonth ()-date.getMonth (month) {return month + January Front'} let day = now.getDate ()-date.getDate () if (day) {return day + 'days ago'} let hour = now.getHours ()-date.getHours () if (hour) {return hour + 'hour ago'} let min = now.getMinutes ()-date.getMinutes () if (min) {return min + 'minute ago'} return 'just now' }} above is all the contents of the article "sample Analysis of time Intermediate Keys in python". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!