Created
November 12, 2020 15:00
-
-
Save leorush/b3b8e120c546d46af19f23dcd30547b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from datetime import timedelta | |
input_string_list = """[977888]12/11/2020 14:17:21:788 <enodeb0:RRC INFO> 24508:410:08: RRC UL DCCH SDU for RNTI 256 0802c270 | |
[977889]12/11/2020 14:17:21:788 <enodeb0:APP_TRANSACTIONS INFO> process transaction (CRNTI 256, MSG TYPE 3, MSG REF COUNT 1, TRANS TYPE 21, TRANS ID 0x84c080, TRANS REF COUNT 1) | |
[977890]12/11/2020 14:17:21:788 <enodeb0:ANR HIGH> rptCfgTyp = 8 | |
[977891]12/11/2020 14:17:21:788 <enodeb0:ANR INFO> PERIODICAL ANR MEASUREMENT REPORT: RCVD - EUTRA STRONG CELL (CRNTI 256, MEAS ID 6, FREQ 40798) | |
[977892]12/11/2020 14:17:21:788 <enodeb0:ANR HIGH> Enter wrUmmFindNewPciFrmAnrMeasRpt | |
[977893]12/11/2020 14:17:21:788 <enodeb0:ANR HIGH> Exit wrUmmFindNewPciFrmAnrMeasRpt | |
[977894]12/11/2020 14:17:21:788 <enodeb0:ANR HIGH> isRptCgiCfg = 0 intraNewPci count = 0 interNewPciLst count = 0 measObj nrType = 0 | |
[977895]12/11/2020 14:17:21:933 <enodeb0:RRC INFO> 24508:425:03: RRC UL DCCH SDU for RNTI 258 0802c270 | |
[977896]12/11/2020 14:17:21:933 <enodeb0:APP_TRANSACTIONS INFO> process transaction (CRNTI 258, MSG TYPE 3, MSG REF COUNT 1, TRANS TYPE 21, TRANS ID 0x84d080, TRANS REF COUNT 1) | |
[977897]12/11/2020 14:17:21:933 <enodeb0:ANR HIGH> rptCfgTyp = 8""".split("\n") | |
item = input_string_list[0] | |
parsed_time = datetime.strptime(item[item.find("]")+1:item.find("<")-1], "%m/%d/%Y %H:%M:%S:%f") | |
new_time = parsed_time + timedelta(hours=3) | |
print(item[:item.find("]")+1] + str(new_time) + item[item.find("<")-1:]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment