Raised This Month: $32 Target: $400
 8% 

Solved Copy first 2 characters of a string into another string


Post New Thread Reply   
 
Thread Tools Display Modes
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-17-2018 , 05:52   Re: Copy first 2 characters of a string into another string
Reply With Quote #11

Quote:
Originally Posted by KliPPy View Post
Instead of saying "I don't get how modulus operator works" you should learn it, it's a basic concept that's taught in elementary school when you are like 11 or so (remember division remainders?). Same goes for your other topic where you reject the answer because you don't understand Unix timestamps. Learn the right way to do things, operations on time/time spans should only be done in Unix timestamps.
Well, it's embarrassing to say but we never used it in elementary, that's why I have no clue what it does, I never even knew it existed until few months back. So basically it returns the division remainder of X and Y? 7 % 3 the remainder being 1? It's not that I suck at maths, it's that I've never used it before.

Furthermore, I never used Unix, that's why I try to avoid it, and why would one use Unix when you can do that already with AMXX? Such as here.
__________________

Last edited by edon1337; 08-17-2018 at 05:55.
edon1337 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-17-2018 , 06:46   Re: Copy first 2 characters of a string into another string
Reply With Quote #12

Yes, it's that. You have done long division in elementary school, and long division occasionally had you left with a remainder. That's what the modulus operator returns.

You would use Unix time because it's a lot more performant than handling strings, there's less room for error and you take out the "human" aspect of it (there are many different formats for date and time). The Unix time is basically the number of seconds passed since 1.1.1970.
__________________
klippy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-17-2018 , 23:35   Re: Copy first 2 characters of a string into another string
Reply With Quote #13

Quote:
Originally Posted by edon1337 View Post
Well, it's embarrassing to say but we never used it in elementary
They don't typically teach the programming language term "modulus" in elementary (maybe they do a little nowadays) but they teach division.

Quote:
Originally Posted by edon1337 View Post
Furthermore, I never used Unix, that's why I try to avoid it, and why would one use Unix when you can do that already with AMXX?
The Unix timestamp is a simple concept and isn't only available in Unix. The concept is used just about everywhere. Like Klippy said, it's simply a number of seconds since a specific, known, common date which happens to be January 1st 1970.
__________________
fysiks is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-18-2018 , 08:36   Re: Copy first 2 characters of a string into another string
Reply With Quote #14

Quote:
Originally Posted by fysiks View Post
The Unix timestamp is a simple concept and isn't only available in Unix. The concept is used just about everywhere. Like Klippy said, it's simply a number of seconds since a specific, known, common date which happens to be January 1st 1970.
I get how it works now, thanks for your answers!
__________________
edon1337 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode