I'm loading the YouTube API by jQuery + JSON to get the video info of it's views and duration.
The duration number for example is 210 sample, but in actually time, it's 3:30. :)
The problem is, I'm not sure how to come by to converting the numbers to actually time, not even with PHP's strtotime since I believe jQuery would load too late for that. (Or I don't know at all.) :p
In rare occasions when you turn your computer on you will be greeted with a secureboot error followed by the message "No boot device found"
If you go into the UEFI and disable secureboot the system boots up just fine.
Below is a methoid I found online to fix the issue
Disable Secureboot and boot into Windows (If Bitlocker is enable you'll have to go to https://aka.ms/myrecoverykey on another device to find your bitlocker recovery key).
Find a flash drive and make sure it's formatted Fat32
Create a folder on the flash drive called EFI and a subfolder inside EFI called BOOT
On your computer navigate to C:\windows\boot\EFI
Copy the file SecureBootRecovery.efi to your flash drive\EFI\BOOT
Now reboot the computer and tell the computer to boot off that flash drive. You should see a black screen with some text telling you it has repaired secureboot
Turn secureboot back on and reboot and your computer should boot normally.
There is a huge portion of the Windows users who use a cooperate provided computer, which means they are using an organization provided username and not a Microsoft account. Also, those users may not be allowed to install a 3rd party browser, so this would be perfect for them.
COBOL itself is not the problem. Code that has been bodged and kludged over decades but still somehow runs is probably the sort of Gordian knot that even AI can't necessarily unravel.
Recent Achievements
Huge Trailer earned a badge Week One Done
Classifyskilleducation earned a badge Week One Done
Question
Mr.XXIV
I'm loading the YouTube API by jQuery + JSON to get the video info of it's views and duration.
The duration number for example is 210 sample, but in actually time, it's 3:30. :)
The problem is, I'm not sure how to come by to converting the numbers to actually time, not even with PHP's strtotime since I believe jQuery would load too late for that. (Or I don't know at all.) :p
<div id="sidebar"> <h3>Related Videos</h3> <ul id="related-videos"> <?php $the_query = new WP_Query( array( 'posts_per_page' => '5', 'post_format' => 'post-format-video','category_name' => 'hip-hop') ); while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <li> <a href="<?php the_permalink();?>"> <div class="side-thumb"><?php the_post_thumbnail('small'); ?></div> <?php the_title(); ?><br /> <script type="text/javascript"> $(document).ready(function () { $.getJSON('http://gdata.youtube.com/feeds/api/videos/<?php echo getYouTubeIdFromURL(get_post_meta($post->ID,'video',true)); ?> ?v=2&alt=jsonc',function(data,status,xhr){ $("#yt_time-<?php echo get_the_ID(); ?>").html(data.data.duration); $("#yt_views-<?php echo get_the_ID(); ?>").html(data.data.viewCount); }); }); </script> <span><div class="yt">Duration: </div><div id="yt_time-<?php echo get_the_ID(); ?>" class="yt"></div><div class="yt"> | </div><div class="yt">Views: </div><div id="yt_views-<?php echo get_the_ID(); ?>"class="yt"></div></span> </a> </li> <?php endwhile;wp_reset_postdata();?> </ul><!-- #related-videos --> </div><!-- #sidebar -->I think this is the solution, but I don't exactly know how to use it. This code is from Stack Overflow.
<?php date('Y-m-d H:i:s', strtotime(sprintf('- %d second', round($speed * 60)))); ?>Here's a screenshot of what I'm working on. Check out the "Related Videos" on the bottom right.
Link to comment
https://www.neowin.net/forum/topic/1111301-convert-video-duration-number-to-time-with-php-or-jquery/Share on other sites
19 answers to this question
Recommended Posts