Sergey_New Well-Known Member Licensed User Longtime User Sep 7, 2025 #1 Please tell me how to convert the string "21/01/2020" to "01/21/2020". I need this to get ticks from a date in "MM.dd.yyyy" format using DateTime.DateParse Last edited: Sep 7, 2025
Please tell me how to convert the string "21/01/2020" to "01/21/2020". I need this to get ticks from a date in "MM.dd.yyyy" format using DateTime.DateParse
E emexes Expert Licensed User Longtime User Sep 9, 2025 #41 Is this for GEDCOM files? Or something similar? Can you post some sample date data? Upvote 0
LucaMs Expert Licensed User Longtime User Sep 9, 2025 #42 emexes said: Is this for GEDCOM files? Or something similar? Can you post some sample date data? Click to expand... I wonder how you knew that stuff, GEDCOM! I had to look it up, and now I know; I also "know" that I don't understand its "great" utility. Upvote 0
emexes said: Is this for GEDCOM files? Or something similar? Can you post some sample date data? Click to expand... I wonder how you knew that stuff, GEDCOM! I had to look it up, and now I know; I also "know" that I don't understand its "great" utility.
DonManfred Expert Licensed User Longtime User Sep 9, 2025 #43 LucaMs said: I wonder how you knew that stuff, GEDCOM! Click to expand... Gedcom is not a new Format. It´s base is from 1985 already. Genealogy by itself is also not new ;-) Upvote 0
LucaMs said: I wonder how you knew that stuff, GEDCOM! Click to expand... Gedcom is not a new Format. It´s base is from 1985 already. Genealogy by itself is also not new ;-)
LucaMs Expert Licensed User Longtime User Sep 9, 2025 #44 DonManfred said: Genealogy by itself is also not new ;-) Click to expand... I knew this "maybe" Upvote 0
E emexes Expert Licensed User Longtime User Sep 9, 2025 #45 emexes said: GEDCOM files Click to expand... If the original data is dates, then is usually better to keep it as dates, rather than needlessly converting it to ticks and back, because sometimes that doesn't work the way you'd expect, eg if the conversion to ticks is encoded on a device with one time zone setting and decoded on another device that has a different time zone setting, or you have date ranges crossing daylight-savings boundaries. Upvote 0
emexes said: GEDCOM files Click to expand... If the original data is dates, then is usually better to keep it as dates, rather than needlessly converting it to ticks and back, because sometimes that doesn't work the way you'd expect, eg if the conversion to ticks is encoded on a device with one time zone setting and decoded on another device that has a different time zone setting, or you have date ranges crossing daylight-savings boundaries.
Sergey_New Well-Known Member Licensed User Longtime User Sep 9, 2025 #46 Now you are familiar with the GEDCOM standard I have attached a working example. The example sets out my request. Oops. Forgot to delete comments. The example works correctly. Attachments Test.zip Test.zip 3.8 KB · Views: 242 Last edited: Sep 9, 2025 Upvote 0
Now you are familiar with the GEDCOM standard I have attached a working example. The example sets out my request. Oops. Forgot to delete comments. The example works correctly.
E emexes Expert Licensed User Longtime User Sep 11, 2025 #47 emexes said: sometimes that doesn't work the way you'd expect Click to expand... Example: today is 24 years since 911 but fall of north tower on 11-Sep-2001 actually happened here on 12-Sep-2001. Albeit not by much: I remember watching the first tower fall, and then there was a click and the tv went dead which freaked me out a bit, until I realised it was the powerpoint timer that I'd set up to turn the tv off every midnight to deal with my habit of falling asleep in front of the tv. Upvote 0
emexes said: sometimes that doesn't work the way you'd expect Click to expand... Example: today is 24 years since 911 but fall of north tower on 11-Sep-2001 actually happened here on 12-Sep-2001. Albeit not by much: I remember watching the first tower fall, and then there was a click and the tv went dead which freaked me out a bit, until I realised it was the powerpoint timer that I'd set up to turn the tv off every midnight to deal with my habit of falling asleep in front of the tv.
Sergey_New Well-Known Member Licensed User Longtime User Sep 11, 2025 #48 emexes said: Example: Click to expand... Thank you! There are probably other exceptions that affect the result. For GedCom purposes, this is not very important. Upvote 0
emexes said: Example: Click to expand... Thank you! There are probably other exceptions that affect the result. For GedCom purposes, this is not very important.
Lucas Siqueira Active Member Licensed User Longtime User Sep 11, 2025 #49 Sergey_New said: Please tell me how to convert the string "21/01/2020" to "01/21/2020". I need this to get ticks from a date in "MM.dd.yyyy" format using DateTime.DateParse Click to expand... I created some formatting and conversions of dates and other formats [B4X] BR_FunctionsUtils, BR Functions Utils Functions created by Brazilians that can be useful for everyone. BR_FunctionsUtils Autor: Lucas Siqueira Versão: 1.0 V1.00 -Release -Funções Formatar * somenteNumeros("R$ 2.500,00") --> "250000" * telefone("99999999999") --> (99) 99999-9999 *... www.b4x.com B4X: Dim date1 As String = "21/01/2020" Dim date2 As String = br.data.data(date1, "dd/MM/yyyy", "MM/dd/yyyy") Log("date1: " & date1) Log("date2: " & date2) Upvote 0
Sergey_New said: Please tell me how to convert the string "21/01/2020" to "01/21/2020". I need this to get ticks from a date in "MM.dd.yyyy" format using DateTime.DateParse Click to expand... I created some formatting and conversions of dates and other formats [B4X] BR_FunctionsUtils, BR Functions Utils Functions created by Brazilians that can be useful for everyone. BR_FunctionsUtils Autor: Lucas Siqueira Versão: 1.0 V1.00 -Release -Funções Formatar * somenteNumeros("R$ 2.500,00") --> "250000" * telefone("99999999999") --> (99) 99999-9999 *... www.b4x.com B4X: Dim date1 As String = "21/01/2020" Dim date2 As String = br.data.data(date1, "dd/MM/yyyy", "MM/dd/yyyy") Log("date1: " & date1) Log("date2: " & date2)
Sergey_New Well-Known Member Licensed User Longtime User Sep 11, 2025 #50 Lucas Siqueira said: I created some formatting and conversions of dates and other formats Click to expand... Thank you, I will use it! Upvote 0
Lucas Siqueira said: I created some formatting and conversions of dates and other formats Click to expand... Thank you, I will use it!