Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
-2
Question by PeterPam · Sep 19, 2018 at 07:07 PM · texttime

how to convert youtube videos duration time to seconds

Hi

I have the duration for youtube videos in the format 12M34S (12 minutes and 34 seconds) how to convert this to seconds? is there any function for this? thanks in advance

I add the code for this:

 void Start () {
         var dura = "7M25S";
            var arr = dura.Split(new string[] { "M" }, StringSplitOptions.None);
         arr[0] = arr[0].Trim();
         arr[1] = arr[1].Trim().Replace("S","");
         var durat = (int.Parse (arr [0]) * 60) + int.Parse(arr [1]);
            Debug.Log(durat);
     }

I hate stupid god thinking people closing questions from other people. He closes the questions and avoid get responses. Does it bother you that it is open and that someone can respond? Stupid people.

Comment
Add comment · Show 7
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Sep 19, 2018 at 07:26 PM 0
Share

This isn't related to Unity at all. Or if it is you failed to show the link betweeh your Unity project and the start time stamp of youtube videos.


Apart from that your "youtube time" is a string. So you would need to split it into it's parts, strip away any characters which are not numbers, parse those string parts into actual numbers and assemble a single number from those numbers. It should be obvious that you have to multiply the $$anonymous$$utes by 60 and add the seconds.


Though since this question is off topic i will close the question.

avatar image PeterPam Bunny83 · Sep 20, 2018 at 07:42 AM -1
Share

The project is not needed. The start time is shown in the question: format 12$$anonymous$$34S (12 $$anonymous$$utes and 34 seconds) .

If my question is not right made, how have you understood the problem and give a response? Seems you are a stupid moderator with some kind of problem and wants revenge with the newbies...

BTW, thanks for your response. Put me in the right way for solve the problem. Thanks.

avatar image Bunny83 PeterPam · Sep 20, 2018 at 05:25 PM 1
Share

UnityAnswer is for questions about Unity. So every question needs to have some relevance within the scope of Unity.


UnityAnswers is not a general purpose Q&A site. There are countless other general purpose sites out there. For general program$$anonymous$$g questions there is StackOverflow. Though they have much stricter rules which questions are allowed.


Note that all the examples of other questions still fall within the scope of Unity. The first one was a syntax question about UnityScript (which Unity advertised as JavaScript). The second one, even it was a C# question, clearly was within the scope of Unity. Also note that those questions all have included the code what they have tried so far to solve their problem but they got stuck at some point. Your question didn't include any reference just asks for a solution.


Feel free to read the moderator guidelines yourself.


Since you now have added a code snippet which at least gives some Unity relationship I can move your question into the HelpRoom.

[5]: https://answers.unity.com/page/faq.html

Show more comments

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

95 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Type out text in sync with audioclip 0 Answers

How to export in a text file float numbers generated in a list 1 Answer

How can I do a timer with this script? 1 Answer

What is the best way to search a text clock UI for certain times 0 Answers

Hide (not delete) text after given time..? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges