Forum Discussion
Zdenda
Cirrus
Feb 23, 2018API Rest, what lastUpdateMicros is?
Hi,
what is parameter "lastUpdateMicros" and can I get real daytime from that?
I need to know since when some ASM objects are in staging and although I can see real daytime in GUI, in API I see only lastUpdateMicros like here:
{ u'allowed': True,
u'checkPostDataLength': True,
u'checkQueryStringLength': True,
u'checkRequestLength': True,
u'checkUrlLength': True,
u'id': u'w2u9JYt-5pTrmHIhsrGXsA',
u'kind': u'tm:asm:policies:filetypes:filetypestate',
u'lastUpdateMicros': 1519382317000000.0,
u'name': u'jpg',
u'performStaging': True,
u'postDataLength': 1000,
u'queryStringLength': 1000,
u'requestLength': 5000,
u'responseCheck': False,
u'selfLink': u'https://localhost/mgmt/tm/asm/policies/9gV6OhNsX7jnw9sPSfRGmQ/filetypes/w2u9JYt-5pTrmHIhsrGXsA?ver=12.1.2',
u'type': u'explicit',
u'urlLength': 100}
Thanks, Zdenek
- Satoshi_Toyosa1Ret. Employee
is the date/time represented in micro seconds since 1970-01-01 00:00:00 GMT (Unix epoch). For example, 1519382317000000 is Friday, 23 February 2018 10:38:37.lastUpdateMicros
There are several ways to convert. If you want to do it from a BIG-IP bash, JavaScript/Node might be handy. Note that the JavaScript's
expects milliseconds, so trim the last three digits. e.g.,Date
[root@ltm1300:Active:Disconnected] config node > d = new Date(1519382317000) Fri Feb 23 2018 23:38:37 GMT+1300 (NZDT)
- Satoshi_Toyosa1Ret. Employee
P.S. This one is easier. Trim the last six digits.
[root@ltm1300:Active:In Sync] config date --date=@1519382317 Fri Feb 23 23:38:37 NZDT 2018
- Satoshi_Toyosa1Ret. Employee
How about this?
root@ltm1300:Active:In Sync] config python ... >>> import datetime >>> datetime.datetime.fromtimestamp(1519382317).__str__() '2018-02-23 23:38:37'
Bonus: perl version 🙂
[root@ltm1300:Active:In Sync] config perl -e 'use POSIX; print strftime("%Y/%m/%d %H:%M:%S\n", localtime(1519382317))' 2018/02/23 23:38:37
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects