Python time._STRUCT_TM_ITEMS Examples

The following are 12 code examples for showing how to use time._STRUCT_TM_ITEMS(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module time , or try the search function .

Example 1
Project: jawfish   Author: war-and-code   File: _strptime.py    License: MIT License 5 votes vote down vote up
def _strptime_time(data_string, format="%a %b %d %H:%M:%S %Y"):
    """Return a time struct based on the input string and the
    format string."""
    tt = _strptime(data_string, format)[0]
    return time.struct_time(tt[:time._STRUCT_TM_ITEMS]) 
Example 2
Project: Fluid-Designer   Author: Microvellum   File: _strptime.py    License: GNU General Public License v3.0 5 votes vote down vote up
def _strptime_time(data_string, format="%a %b %d %H:%M:%S %Y"):
    """Return a time struct based on the input string and the
    format string."""
    tt = _strptime(data_string, format)[0]
    return time.struct_time(tt[:time._STRUCT_TM_ITEMS]) 
Example 3
Project: Fluid-Designer   Author: Microvellum   File: test_structseq.py    License: GNU General Public License v3.0 5 votes vote down vote up
def test_fields(self):
        t = time.gmtime()
        self.assertEqual(len(t), t.n_sequence_fields)
        self.assertEqual(t.n_unnamed_fields, 0)
        self.assertEqual(t.n_fields, time._STRUCT_TM_ITEMS) 
Example 4
Project: Imogen   Author: CedricGuillemet   File: _strptime.py    License: MIT License 5 votes vote down vote up
def _strptime_time(data_string, format="%a %b %d %H:%M:%S %Y"):
    """Return a time struct based on the input string and the
    format string."""
    tt = _strptime(data_string, format)[0]
    return time.struct_time(tt[:time._STRUCT_TM_ITEMS]) 
Example 5
Project: ironpython3   Author: IronLanguages   File: _strptime.py    License: Apache License 2.0 5 votes vote down vote up
def _strptime_time(data_string, format="%a %b %d %H:%M:%S %Y"):
    """Return a time struct based on the input string and the
    format string."""
    tt = _strptime(data_string, format)[0]
    return time.struct_time(tt[:time._STRUCT_TM_ITEMS]) 
Example 6
Project: ironpython3   Author: IronLanguages   File: test_structseq.py    License: Apache License 2.0 5 votes vote down vote up
def test_fields(self):
        t = time.gmtime()
        self.assertEqual(len(t), t.n_sequence_fields)
        self.assertEqual(t.n_unnamed_fields, 0)
        self.assertEqual(t.n_fields, time._STRUCT_TM_ITEMS) 
Example 7
Project: Project-New-Reign---Nemesis-Main   Author: ShikyoKira   File: _strptime.py    License: GNU General Public License v3.0 5 votes vote down vote up
def _strptime_time(data_string, format="%a %b %d %H:%M:%S %Y"):
    """Return a time struct based on the input string and the
    format string."""
    tt = _strptime(data_string, format)[0]
    return time.struct_time(tt[:time._STRUCT_TM_ITEMS]) 
Example 8
def test_fields(self):
        t = time.gmtime()
        self.assertEqual(len(t), t.n_sequence_fields)
        self.assertEqual(t.n_unnamed_fields, 0)
        self.assertEqual(t.n_fields, time._STRUCT_TM_ITEMS) 
Example 9
Project: odoo13-x64   Author: guohuadeng   File: _strptime.py    License: GNU General Public License v3.0 5 votes vote down vote up
def _strptime_time(data_string, format="%a %b %d %H:%M:%S %Y"):
    """Return a time struct based on the input string and the
    format string."""
    tt = _strptime(data_string, format)[0]
    return time.struct_time(tt[:time._STRUCT_TM_ITEMS]) 
Example 10
Project: Carnets   Author: holzschu   File: _strptime.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def _strptime_time(data_string, format="%a %b %d %H:%M:%S %Y"):
    """Return a time struct based on the input string and the
    format string."""
    tt = _strptime(data_string, format)[0]
    return time.struct_time(tt[:time._STRUCT_TM_ITEMS]) 
Example 11
Project: Carnets   Author: holzschu   File: _strptime.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def _strptime_time(data_string, format="%a %b %d %H:%M:%S %Y"):
    """Return a time struct based on the input string and the
    format string."""
    tt = _strptime(data_string, format)[0]
    return time.struct_time(tt[:time._STRUCT_TM_ITEMS]) 
Example 12
Project: android_universal   Author: bkerler   File: _strptime.py    License: MIT License 5 votes vote down vote up
def _strptime_time(data_string, format="%a %b %d %H:%M:%S %Y"):
    """Return a time struct based on the input string and the
    format string."""
    tt = _strptime(data_string, format)[0]
    return time.struct_time(tt[:time._STRUCT_TM_ITEMS])