Get the App
SLTechnology News&Howtos  ›  Development  › 

Example Analysis of time Intermediate key in python

Shulou Source: shulou.com Published: 2022-06-03 16:01:17 10月03日 Update

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!

Tags: Content examples mid-time analysis time articles value interests guys partners hours years ago interfaces data methods more knowledge nodes industry information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia OPPO Reno Shulou Tech Info Docker Apple