469,964 Members | 1,765 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

incrementing HH:MM:SS information: any method or datatype to save me time in .NET?


I'm doing some work with ffmpeg, which lets you work with audio and video.

ffmpeg's command line accepts timecode information as folllows: 00:00:23.
HH:MM.SS

I want to increment that counter, say, adding ten seconds 1000 times.

I could hack up my own string thingy to do this, but I'm betting there's a
way to do this within the .NET framework.

Is there? Can someone point the way?

-KF
Feb 13 '07 #1
3 1175
Google...
time class overview site:msdn2.microsoft.com

--
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP http://wikimapia.org/#y=43038073&x=-...8&z=17&l=0&m=h
<ke*****@nospam.nospamwrote in message
news:e0**************@TK2MSFTNGP05.phx.gbl...
>
I'm doing some work with ffmpeg, which lets you work with audio and video.

ffmpeg's command line accepts timecode information as folllows: 00:00:23.
HH:MM.SS

I want to increment that counter, say, adding ten seconds 1000 times.

I could hack up my own string thingy to do this, but I'm betting there's a
way to do this within the .NET framework.

Is there? Can someone point the way?

-KF

Feb 13 '07 #2
Hi,

Use DateTime variable as counter and convert it to string when you need it
(it's more efficient):

// offset
DateTime date = new DateTime(1, 1, 1, 0, 0, 0);

for (int i = 1; i <= 1000; i++)
{
date = date.AddSeconds(10.0d);

string ffmpegParam = date.ToLongTimeString();
}

--
Milosz
"ke*****@nospam.nospam" wrote:
>
I'm doing some work with ffmpeg, which lets you work with audio and video.

ffmpeg's command line accepts timecode information as folllows: 00:00:23.
HH:MM.SS

I want to increment that counter, say, adding ten seconds 1000 times.

I could hack up my own string thingy to do this, but I'm betting there's a
way to do this within the .NET framework.

Is there? Can someone point the way?

-KF
Feb 13 '07 #3
Ah, great, thanks to both of you. Exactly what I needed.

-KF

"Milosz Skalecki [MCAD]" <mi*****@DONTLIKESPAMwp.plwrote in message
news:C6**********************************@microsof t.com...
Hi,

Use DateTime variable as counter and convert it to string when you need it
(it's more efficient):

// offset
DateTime date = new DateTime(1, 1, 1, 0, 0, 0);

for (int i = 1; i <= 1000; i++)
{
date = date.AddSeconds(10.0d);

string ffmpegParam = date.ToLongTimeString();
}

--
Milosz
"ke*****@nospam.nospam" wrote:
>>
I'm doing some work with ffmpeg, which lets you work with audio and
video.

ffmpeg's command line accepts timecode information as folllows: 00:00:23.
HH:MM.SS

I want to increment that counter, say, adding ten seconds 1000 times.

I could hack up my own string thingy to do this, but I'm betting there's
a
way to do this within the .NET framework.

Is there? Can someone point the way?

-KF

Feb 13 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Able | last post: by
2 posts views Thread by Robert Brown | last post: by
5 posts views Thread by kpp9c | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.