Trimming Seconds

Code:

StartTime = FormatDateTime((rs("startdate")),3)

this returns

7/4/2006 1:00:00 AM

I need to trim the seconds off so it looks like this

7/4/2006 1:00 AM

View Replies


ADVERTISEMENT

Trimming 0

My record returns a numerical string "02". When I response.write it I want to remove the "0" ONLY from the beginnings. How would I do that?

View Replies View Related

Timestamp In Seconds ?

i need to get the number of seconds since Jan 1, 1990 or 70 or something to compare session times ... how do i get the timestamp in seconds ...

btw the msdn library is not a very good one ... does any one know an asp manual simillar to php (downloadble) ...

View Replies View Related

Trimming Text

I know that trim removes white space and the LTrim and R trim removes space from the left or right but how would i trim a string after 20 characters so that i could add ... to the end of the new trimmed string???

View Replies View Related

Trimming Strings

if i had a string which looked like this :

,apple, orange, grape, tomatoes

how do i remove the first character[,] from the string using the trim() function?

View Replies View Related

Trimming Db Results

i don't know what to do here exactly.
i have seen the TRIM function, but i'm not sure if it's the right way to do it.
i have a recordset called RSUSEREDIT.
in the recordset there is a column called "EMail".
i can print out the results using Code:

<%=RSUSEREDIT("Email")%>

the email column always uses the same domain name... - username@domain.com
is it possible to remove the part after and including the "@"?

View Replies View Related

Trimming Commas

I'm dynamically building an SQL string to do an execute, and keep ending up with a leftover comma, so the string looks like this.

INSERT INTO Software ( Title, Version, Licensing, Total_Licenses, support_phone, support_email, Campuses_Licensed, Comments, support_web, FundingSource, Course_title, Subject, Grade_level, LocalExpert, ACTIVE, CATE, EntryDate,) VALUES ( 'Bob's Super Crappy Software', '4.3', 'labpack', '36', '555', '555', 'Alexander, Bilhartz, Central, Fairmeadows, Hyman, Daniel', 'James is testing this', 'www.bob.com', 'Campus PO', 'Math', 'Math', '4, 5, 6', 'Patrick Williams', '1', '0',)

Both commas are added dynamically and can be trimmed on the fly. I tried using RTRIM(strSQL, ",") but this didn't work.I put the fields into an array and tried to add only commas to all but the last entry, but that also didn't work.

View Replies View Related

Trimming Words

I have a database field that is a memo type. I would like to be able to only display the first 50 words from the database. I would like for it to show ..... after about 50 words.

I am using <%=Content %>. How do I trim this field to show only 50 words and then ....?

I tried the following code:
Function LengthTrim(input, length)
If Len(input) > length Then
Return Left(input, length) + "..."
Else
Return input
End If
End Function

then <%= LengthTrim(Content, 50) %>

But it would not work. I got the following error message:

Microsoft VBScript runtime error '800a01f4'Variable is undefined: 'Return' .

View Replies View Related

Trimming Filename

I am storing URL in a database for a 'sort of' directory type website.The <a href> is built from the recordset of URL's which is all working no problem, easy stuff.What I have found is going to be necessary in some cases is to trim the URL back to just it's www.abc.co.uk address for the link display.

I still want the actual link to go to it's long 'deep linking' location, but there is limited room for displaying a URL that could be a hundred chars long.

View Replies View Related

Trimming The Field

I have a section on my website that lets users to input their own username and password in order to enter the restricted area, but i notice that some of the users likes to use strange characters to use as their username or password.

how could I trim those strange characters ie. like the follow !@#$%^&*()'{}/?~ out of the input field, WITHOUT using the javascript because javascript can be disabled from the browser and by only using the ASP IF ELSEIF statements to do so?

View Replies View Related

Trimming Whitespace

I have an Access db of products which I'd like to use for creating dynamic urls. Each product has a range name which I intend to use to point to the folder containing the relevant image eg pine/001.jpg

My problem is one of the ranges has two names ie Indian Accessories. I can't have a url with a space in it so how can I dynamically alter the field so that it displays the url as either indianaccessories or indian-accessories?

View Replies View Related

Trimming A Variable.

I need to trim a variable to have everything after 4 chars in a string.

IE:

var_temp = 200:16:1234567890

i want everything after 200: to be a variable.

I cannot use:

var_new = right(var_temp,14)

because the string is a different length everytime.
I just dont know this function.

View Replies View Related

Trimming A String

Someone should write a book Javascript for VBScript Programmers. I can't seem to find a native function in Javascript to trim a string. Is there one or does anyone have one handy?

View Replies View Related

Date Difference In Seconds

Basically I have 2 times:

timea = (date here) 12:00:00 PM

timeb = now()

and what i want to do is compare the difference in seconds between the two.
But I'm struggling and the thought has crossed my mind that DateDiff only works with dates not times...

Code:

<%
Dim DateToCompareTo
DateToCompareTo = 4/10/2005 1:00:00 PM
%>

There are <%= DateDiff("s", Now(), DateToCompareTo) %> seconds left %>!

View Replies View Related

Seconds To Date Format

I have a variable that returns a certain number of seconds. Is there a function that can format this into something more useful?

For example, if the variable returned is 32, then it would format it to say "32 seconds"

If the variable is 312, then it would return "5 minutes and 12 seconds"

If the variable was 7315 then it would return "2 hours, 1 minute, and 55 seconds"

And so on.

View Replies View Related

Response.Redirect In 5 Seconds?

Is there a way to response.redirect to a url within 5 seconds or something, so its not right away? I was thinking meta refresh, but everywhere I go online it says that meta refreshes are not a good idea.

View Replies View Related

Seconds Portion Of Time

I'm having a problem with this code:
Code:

<input type="hidden" name="lastdate" value="<%=now%>">

not returning the "seconds" portion of time. It writes the date and time - but only to the minute. The seconds are 00 each time. Ex. 1/29/2005 1:47:23 PM is what I want and 1/29/2005 1:47:00 PM is what I'm getting.This is the result I'm getting on two separate DB's on two different servers. I'm sure there's some glaring problem I'm overlooking because I sure can't see it.

View Replies View Related

Converting Seconds To Minutes

I have a column in my Access db that stores a number which is supposed to be seconds. How can I convert the seconds to display mm:ss on my ASP page? For instance, if the number in the db is 300, I want it to display 5:00 on my page.

Now these are lengths of time, not current time (AM or PM), so I dont want it to display the AM or PM. I've tried format(rs("length"), "nn:ss") and that didnt work. Matter of fact Format(), FormatDateTime(), and FormatNumber() doesnt work on my page. I've been getting the 800a000d Type Mismatch error. What am I doing wrong? Code:

View Replies View Related

Redirect A User After A Few Seconds

I'm trying to set up an asp script that redirects a user after a few seconds on a page- I cant use meta tags to redirect due to the page structure.does anyone have any similar scripts they could share?

View Replies View Related

Delay, Sleep For 8 Seconds

What is the best way to do an ASP/sleep for 8 seconds (pause script for 8 seconds)? I have tried the following:

EndTime = Now() + (8 / (24 * 60* 60)) '8 seconds
Do While Now() < EndTime
'Do nothing
Loop

But unfortunately that keeps the CPU at 100% for that time. I need something that doesn't impact the CPU, as this delay will be in a while loop that will execute continuously for a few days.

View Replies View Related

Time Difference In Seconds

I'd like to find the time difference in seconds in my ASP-code, but can't find how to do this. In php you have the time() that give the seconds from 1.1.1970 (?) until now. Is there something like this in ASP too? I have found the DateDiff that one just gives days, right? I basicly want to have two variables, time1 and time2, and show the seconds between them.

View Replies View Related

Time Format: Get Rid Of Seconds

I have a simple calendar scipt that ask for time of event input. While I like the time feature I do not like the fact that it displays with seconds included.

Ex. Displays HR:MIN:SEC 5:05:30 PM

Desired display 5:05 PM

How do I get rid of the display showing seconds? I have changed the database format, but this does not seem to effect the disply on the asp page.

View Replies View Related

Converting Seconds Into Time

I need to convert seconds into time since for a message board application.

"minutes ago, hours ago and days ago" etc.

I have capture the time of the original post and compared it to the time now getting seconds but having a little trouble working out the seconds into time. Have used calculations (/60 minute), (/3600 hour), and (/86400 hour) but the time remaining is bugging me.

View Replies View Related

Trimming Or Rounding Up A Number

if i have a value of 11.7908787541713

how could i trim it to 11.79 and how do i round the number up?

View Replies View Related

Splitting Or Trimming A String

I am taking a field from a database and attaching it to avariable like so:

varID = rsCheckLogin("LogonID")

This is returning, for example, SA70.

I only need the integer part. How would i remove the SA part, i have belive it must be trim or split but not sure how to use them?

View Replies View Related

Trimming Either Side Of A Word

i have a search page results what i want to do is trim the result to 100 chars either side of the matched word but say if the word is at the start or end just to trim 100 chars left or right. does anyone have a function that will do this ?

View Replies View Related

Page Generation Time In Seconds

The code to show how long it took the page to generate in seconds ?!?, if you get onto the main page of this site, www.tgplus.net and loom at the left had side, it tells you how long it took the page 2 generate.

View Replies View Related

Trimming Variables Requested From Form

if iam requesting a form field, how do i trim that to just the first 2 letters Code:

View Replies View Related

Years, Months, Days, Hours, Seconds

Been playing with the function DateDiff, and with it it's easy to calculate the difference in years/months/days between two dates. However, if i wanted to calculate the difference in Years, Months, Days, Hours, Seconds (a la Ebay bids) how can I do this? Is it easy or complicated?

View Replies View Related

Countdown Timer By Day, Hour, Minute And Seconds

how to do the count down timer? which their is count down timer for sepacific day, hour, minute and second.

View Replies View Related

TRIMMING MULTIPLE KEYWORDS On Search Page!

I am trying to make a search page. Once a serach word or words is put in I need it to serach multiple product tables and output the description of any prioduct if the search word is present in the description.

However, If i put in 2 keywords like "paper sticker" I get no results. How do you search multiple keywords? Code:

View Replies View Related

I Am Having Problems With Calculating The Total Seconds From Two Date/times.

I need to get the number of seconds when subtracting two date/times.
With the code I am using below I subtract the two date/times and end
up with a total of days like "1.56".

Then when I multiply it to get
the number of seconds I am not getting an accurate number. I should
only have whole numbers of seconds with nothing past the decimal
point. I would like to be able to subtract the two date/times and get
the number of seconds without multiplying to get it. Is this possible?
Does anyone have a better more accurate way to do this? Code:

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved