<jupyter_start><jupyter_text>Datetime field<jupyter_code>from konfoo import Index, Byteorder, Datetime<jupyter_output><empty_output><jupyter_text>Item Item type of the `field` class.<jupyter_code>Datetime.item_type<jupyter_output><empty_output><jupyter_text>Checks if the `field` class is a `bit` field.<jupyter_code>Datetime.is_bit()<jupyter_output><empty_output><jupyter_text>Checks if the `field` class is a `boolean` field.<jupyter_code>Datetime.is_bool()<jupyter_output><empty_output><jupyter_text>Checks if the `field` class is a `decimal` number field.<jupyter_code>Datetime.is_decimal()<jupyter_output><empty_output><jupyter_text>Checks if the `field` class is a `floating point` number field.<jupyter_code>Datetime.is_float()<jupyter_output><empty_output><jupyter_text>Checks if the `field` class is a `pointer` field.<jupyter_code>Datetime.is_pointer()<jupyter_output><empty_output><jupyter_text>Checks if the `field` class is a `stream` field.<jupyter_code>Datetime.is_stream()<jupyter_output><empty_output><jupyter_text>Checks if the `field` class is a `string` field.<jupyter_code>Datetime.is_string()<jupyter_output><empty_output><jupyter_text>Field<jupyter_code>datetime = Datetime(byte_order='auto')
datetime = Datetime()<jupyter_output><empty_output><jupyter_text>Field view<jupyter_code>datetime
str(datetime)
repr(datetime)<jupyter_output><empty_output><jupyter_text>Field name<jupyter_code>datetime.name<jupyter_output><empty_output><jupyter_text>Field index<jupyter_code>datetime.index<jupyter_output><empty_output><jupyter_text>Byte `index` of the `field` within the `byte stream`.<jupyter_code>datetime.index.byte<jupyter_output><empty_output><jupyter_text>Bit offset relative to the byte `index` of the `field` within the `byte stream`.<jupyter_code>datetime.index.bit<jupyter_output><empty_output><jupyter_text>Absolute address of the `field` within the `data source`.<jupyter_code>datetime.index.address<jupyter_output><empty_output><jupyter_text>Base address of the `byte stream` within the `data source`.<jupyter_code>datetime.index.base_address<jupyter_output><empty_output><jupyter_text>Indexes the `field` and returns the `index` after the `field`.<jupyter_code>datetime.index_field(index=Index())<jupyter_output><empty_output><jupyter_text>Field alignment<jupyter_code>datetime.alignment<jupyter_output><empty_output><jupyter_text>Byte size of the `field group` which the `field` is *aligned* to.<jupyter_code>datetime.alignment.byte_size<jupyter_output><empty_output><jupyter_text>Bit offset of the `field` within its *aligned* `field group`.<jupyter_code>datetime.alignment.bit_offset<jupyter_output><empty_output><jupyter_text>Field size<jupyter_code>datetime.bit_size<jupyter_output><empty_output><jupyter_text>Field byte order<jupyter_code>datetime.byte_order
datetime.byte_order.value
datetime.byte_order.name
datetime.byte_order = 'auto'
datetime.byte_order = Byteorder.auto<jupyter_output><empty_output><jupyter_text>Field value Checks if the decimal `field` is signed or unsigned.<jupyter_code>datetime.signed<jupyter_output><empty_output><jupyter_text>Maximal decimal `field` value.<jupyter_code>datetime.max()<jupyter_output><empty_output><jupyter_text>Minimal decimal `field` value.<jupyter_code>datetime.min()<jupyter_output><empty_output><jupyter_text>Returns the datetime `field` value as an UTC datetime string in the ISO format ``YYYY-mm-dd HH:MM:SS``.<jupyter_code>datetime.value<jupyter_output><empty_output><jupyter_text>Returns the decimal `field` value *aligned* to its `field group` as a number of bytes.<jupyter_code>bytes(datetime)
bytes(datetime).hex()<jupyter_output><empty_output><jupyter_text>Returns the decimal `field` value as an integer number.<jupyter_code>int(datetime)<jupyter_output><empty_output><jupyter_text>Returns the decimal `field` value as an floating point number.<jupyter_code>float(datetime)<jupyter_output><empty_output><jupyter_text>Returns the decimal `field` value as a lowercase hexadecimal string prefixed with `0x`.<jupyter_code>hex(datetime)<jupyter_output><empty_output><jupyter_text>Returns the decimal `field` value as a binary string prefixed with `0b`.<jupyter_code>bin(datetime)<jupyter_output><empty_output><jupyter_text>Returns the decimal `field` value as a boolean value.<jupyter_code>oct(datetime)<jupyter_output><empty_output><jupyter_text>Returns the decimal `field` value as a boolean value.<jupyter_code>bool(datetime)<jupyter_output><empty_output><jupyter_text>Returns the decimal `field` value as a signed integer number.<jupyter_code>datetime.as_signed()<jupyter_output><empty_output><jupyter_text>Returns the decimal `field` value as an unsigned integer number.<jupyter_code>datetime.as_unsigned()<jupyter_output><empty_output><jupyter_text>Field metadata Returns the ``meatadata`` of the ``field`` as an ordered dictionary.<jupyter_code>datetime.describe()<jupyter_output><empty_output><jupyter_text>Deserialize<jupyter_code>datetime.deserialize(bytes.fromhex('01000000'), byte_order='little')
datetime.value
bytes(datetime)
bytes(datetime).hex()
int(datetime)
float(datetime)
hex(datetime)
bin(datetime)
oct(datetime)
bool(datetime)<jupyter_output><empty_output><jupyter_text>Serialize<jupyter_code>buffer = bytearray()
datetime.value = 1
datetime.value = 1.0
datetime.value = 0x1
datetime.value = 0b1
datetime.value = 0o1
datetime.value = True
datetime.value = '1970-01-01 00:00:01'
datetime.serialize(buffer, byte_order='little')
buffer.hex()
bytes(datetime).hex()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11607629427792915, 'fraction_numerical': 0.005994550408719346, 'mean_word_length': 12.140811455847256, 'pattern_counts': {'":': 0, '<': 157, '<?xml version=': 0, '>': 157, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '39', 'dir': 'jupyter-structured-clean-dedup', 'id': '325292', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1960, 'n_tokens_neox': 1924, 'n_words': 318, 'path': 'notebooks/fields/Datetime field.ipynb', 'repo_name': 'JoeVirtual/KonFoo', 'size': '5505'}