1BSON::Timestamp(3) User Contributed Perl Documentation BSON::Timestamp(3)
2
3
4
6 BSON::Timestamp - BSON type wrapper for timestamps
7
9 version v1.12.2
10
12 use BSON::Types ':all';
13
14 bson_timestamp( $seconds );
15 bson_timestamp( $seconds, $increment );
16
18 This module provides a BSON type wrapper for a BSON timestamp value.
19
20 Generally, it should not be used by end-users, but is provided for
21 backwards compatibility.
22
24 seconds
25 A value representing seconds since the Unix epoch. The default is
26 current value of "time()".
27
28 increment
29 A numeric value to disambiguate timestamps in the same second. The
30 default is 0.
31
33 TO_JSON
34 If the "BSON_EXTJSON" option is true, returns a hashref compatible with
35 MongoDB's extended JSON
36 <https://github.com/mongodb/specifications/blob/master/source/extended-
37 json.rst> format, which represents it as a document as follows:
38
39 {"$timestamp" : { "t":<seconds>, "i":<increment> }}
40
41 If the "BSON_EXTJSON" option is false, an error is thrown, as this
42 value can't otherwise be represented in JSON.
43
45 · David Golden <david@mongodb.com>
46
47 · Stefan G. <minimalist@lavabit.com>
48
50 This software is Copyright (c) 2020 by Stefan G. and MongoDB, Inc.
51
52 This is free software, licensed under:
53
54 The Apache License, Version 2.0, January 2004
55
56
57
58perl v5.32.0 2020-08-18 BSON::Timestamp(3)