Jump to content

00:00:22.17 mp3 time to millisecond


Recommended Posts

i can find how to do the opposite but i want to take

00:00:22.17  and put into milliseconds

which would be 22017 ?? or no

seems like it should be super simple but not finding it anywhere.

i get a bunch of audio files with that time stamp and i and i want to to convert to milliseconds

thanks!

Link to comment
Share on other sites

What have you tried yourself so far?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Check out the StringSplit function as one method to get an array, which you will need to do twice. ;)

Hours times 60 to get minutes.

Minutes times 60 to get seconds.

Seconds times 1000 to get milliseconds.

We could provide the code easy enough, but I believe in helping those who help themselves, so as water said, provide us with what you have tried so far, or with what I have now given you a clue to, if necessary. :)

We can help fine tune any issues you can't surmount. :D

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

@mikell - I know you are trying to be helpful, but giving a golden platter solution like that to a seeming newbie, is not really teaching them anything.

As they say, best to learn to walk before learning to ride.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

It is a quite advanced solution (at least for me as I'm not good with regular expressions).

I would have - like TheSaint - suggested to start with StringSplit.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

TheSaint,

You are obviously right but I couldn't help but posting it  :D

BTW I would say lazy instead of newbie

Nothing wrong with posting it once they had tried and succeeded with an easier method. :)

After all, they won't be a newbie forever and many others will see this topic perhaps, and benefit from an advanced solution.

Probably not water and I though, as we tend to avoid RegExp stuff ... so we can sleep at night.

;)

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

I was not being lazy if you see all my posts here i show my solutions every time, not to mention i ask to be sent in right direction...  this topic was not covered anywhere i could find.

i got stuck for hours and wanted to see if anyone had any ideas and when i woke up could work again, no reason to start making assumptions about my laziness etc.

I didn't know where to start is why i started the thread. never said hand me over code.   thanks mikell that is what i was thinking about b4 i went to bed last night.  i wasnt sure it would be that simple i thought i would need to be doing some addition etc... 

 

Link to comment
Share on other sites

@Mikell : just a small remark. You can remove your concatenation and juste keep the calculation :;) 

Func Convert2ms($sTime)
    Return Execute(StringRegExpReplace($sTime, "(\d+):(\d+):(\d+)\.(\d*)", "($1*3600+$2*60+$3)*1000+$4") )
EndFunc

 

Edited by jguinch
Link to comment
Share on other sites

Non regex version:

Func Convert2ms($sTime)
    Return StringLeft($sTime, 2) * 3600000 + StringMid($sTime, 4, 2) * 60000 + StringMid($sTime, 7, 2) * 1000 + StringRight($sTime, 2)
EndFunc

 

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Regex is not only for beginners not easy to understand. Further many ways lead to Rome and it is always good to see more ways. :)

 

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...