Qbasicnews.com
December 10, 2019, 06:57:40 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 2 [3] 4
  Print  
Author Topic: Timezone calculator.  (Read 40567 times)
Moneo
Na_th_an
*****
Posts: 1971


« Reply #30 on: July 29, 2005, 03:00:11 PM »

Quote from: "anarky"
Psuedo code:
Code:

Display cities
Choose your city (this could be preset)
Find own timezone (also maybe preset)
Choose destination city
Find dest city timezone (Mine is in a database, but I am having some curious problems with that)
Calculate difference between own city and GMT, adjust time
Calculate difference betwen destination city and GMT, adjust time


I have not included DST anywhere in the world.  Therefore times may vary. I bet you didn't know Kathmandu is in an ODD timezone (GMT+5:45)?

>anarky

Your psedo-code is a bit too high level when it comes to the  "calculate difference" sections. Give us a little more detail.

Regarding Kathmandu, whereever that is, there are a bunch of places around the world that have partial hourly offsets. They want to be, or don't want to be in the same timezone with a  neighboring country, city, or island.

Our program will put these places into one of the 24 timezone that the world's map indicates, with no adjustments.
*****
Logged
anarky
Been there, done that
*****
Posts: 1231


The Blobworld Comics King


« Reply #31 on: July 29, 2005, 03:01:29 PM »

Ill give you a zip in about 15 minutes. Tongue Expect this post to be modified.

>anarky
Logged

Screwing with your reality since 1998.
rpgfan3233
Ancient Guru
****
Posts: 617



« Reply #32 on: July 29, 2005, 03:28:09 PM »

Quote from: "Moneo"
RPGFAN,

Very good. The main part which calculates the time at the TO timezone, seems to be working.

Had some problems because of not knowing what the format of the input should be. Like the date, what format do you want?

By the way, we had decided that we were not going to calculate dates, only a day adjustment like -1, 0, +1.

I need to do a bit more testing. But in the meantime, you are a stong  contender for winning this challenge. Good work! Cheesy
*****


Oops, sorry. I was looking at your first post for the rules. Tongue It said the dates were in mm/dd/yyyy format and time's were in hh:mm format.

Edit: For testing purposes, you can also use just HHMM or HMM for time and mmddyyyy for the date (no symbols necessary) since it strips the symbols out anyway. Alternatively, you could replace the DO-LOOP section for the date with this code if you want to use the current date:
[syntax="qbasic"]date = DATE$
FOR i = 1 TO LEN(date)
    IF INSTR(key$, MID$(date, i, 1)) <> 0 THEN
        dateStr$ = dateStr$ + MID$(date, i, 1)
    END IF
NEXT i[/syntax]
Since DATE$ is automatically in mm/dd/yyyy format. . .
Logged

974277320612072617420666C61696C21 (Hexadecimal for those who don't know)
DrV
Na_th_an
*****
Posts: 1553



WWW
« Reply #33 on: July 29, 2005, 04:09:19 PM »

Here's my entry (haven't really tested the actual logic, hope it works... have to get back to work Smiley ).  Only tested with FreeBASIC (if it doesn't work in QB, I can change it, if that is important).
Code:
'' tzconv.bas - timezone converter
'' 29-Jul-2005 - DrV - initial version

option explicit

tzdata:
data "London", 0
data "Reykjavik", -1
data "Greenland", -2
data "Rio de Janeiro, Brazil", -3
data "Santiago de Chile", -4
data "New York", -5
data "Chicago", -6
data "Denver", -7
data "Seattle", -8
data "Alaska", -9
data "Honolulu", -10
data "Midway Island", -11
'' no GMT - 12
data "New Zealand", 12
data "Solomon Islands", 11
data "Sydney", 10
data "Tokyo", 9
data "Hong Kong and China", 8 '' obsolete? Hong Kong is once again part of China..
data "Bangkok", 7
data "Omsk, Russia", 6
data "Karachi", 5
data "Stalingrad", 4
data "Moscow", 3
data "Cairo", 2
data "Berlin", 1

type TimeZone
place as string * 22
gmtoffset as integer
end type

dim shared zones(23) as TimeZone

declare function pickzone(title as string) as integer
declare function gmtoffsettostring(gmtoffset as integer) as string
declare function picktime(title as string, h as integer, m as integer)
declare function zerostring(n as integer, chars as integer) as string

dim i as integer, s as string, n as integer
dim localzone as integer, remotezone as integer
dim localtime as string
dim h as integer, m as integer, d as integer

'' get data
restore tzdata
for i = 0 to ubound(zones)
read s, n
zones(i).place = s
zones(i).gmtoffset = n
next i

localzone = pickzone("Local time zone  (arrow keys to select, Enter to accept)")
if localzone = -1 then end
remotezone = pickzone("Remote time zone (arrow keys to select, Enter to accept) ")
if remotezone = -1 then end

print "Local time zone: "; zones(localzone).place;
print gmtoffsettostring(zones(localzone).gmtoffset)
print "Remote time zone:"; zones(remotezone).place;
print gmtoffsettostring(zones(remotezone).gmtoffset)
print
if picktime("Enter local time (up/down keys to change field, left/right keys to select field, Enter to accept) (24-hour format):", h, m) = -1 then end

'' calculate remote time
h = h - zones(localzone).gmtoffset
h = h + zones(remotezone).gmtoffset

if h < 0 then
d = -1
h = h + 24
elseif h > 23 then
d = 1
h = h - 24
end if

print
print "Remote time: "; zerostring(h, 2); ":"; zerostring(m, 2); " ";
if d <> 0 then print zerostring(d, 1); " day"
print
print "Press any key to exit..."
do while len(inkey$) = 0
loop

function pickzone(title as string) as integer
dim i as integer, s as string
dim k as string
dim curr as integer
cls
locate 1, 1, 0 ' hide cursor
print title
for i = 0 to 23
locate 2 + i, 3
print zones(i).place;
locate 2 + i, 3 + 30 + 1
print gmtoffsettostring(zones(i).gmtoffset);
next i
curr = 0
locate curr + 2, 1
print ">";
do
k = inkey$
if len(k) = 1 then
if k = chr$(13) or k = chr$(10) then
pickzone = curr
exit do
elseif k = chr$(27) then ' escape
pickzone = -1
exit do
end if
elseif len(k) = 2 then
select case asc(right$(k, 1))
case 80, 77 ' down, right
if curr < ubound(zones) then
locate curr + 2, 1
print " ";
curr = curr + 1
locate curr + 2, 1
print ">";
end if
case 72, 75 ' up, left
if curr > 0 then
locate curr + 2, 1
print " ";
curr = curr - 1
locate curr + 2, 1
print ">";
end if
end select
end if
loop

exitfunc:
cls
locate 1, 1, 1 ' show cursor
end function

function gmtoffsettostring(gmtoffset as integer) as string
if gmtoffset > 0 then
gmtoffsettostring = "GMT +" + str$(gmtoffset)
else
gmtoffsettostring = "GMT -" + str$(-gmtoffset)
end if
end function

function picktime(title as string, h as integer, m as integer)
dim row as integer, hr as integer, mn as integer, ed as integer
dim k as string
print title
row = csrlin
hr = 0
mn = 0
ed = 0
locate row, 1, 0 ' hide cursor
print zerostring(hr, 2); ":"; zerostring(mn, 2)
print "^^";
do
k = inkey$
if len(k) = 1 then
if k = chr$(10) or k = chr$(13) then
h = hr
m = mn
picktime = 0
exit do
elseif k = chr$(27) then
picktime = -1
exit do
end if
elseif len(k) = 2 then
if ed = 0 then
select case asc(right$(k, 1))
case 77 ' right
ed = 1
locate row + 1, 1
print "   ^^";
case 72 ' up
hr = hr + 1
if hr >= 24 then hr = 0
locate row, 1
print zerostring(hr, 2);
case 80 ' down
hr = hr - 1
if hr <= -1 then hr = 23
locate row, 1
print zerostring(hr, 2);
end select
else
select case asc(right$(k, 1))
case 75 ' left
ed = 0
locate row + 1, 1
print "^^   ";
case 72 ' up
mn = mn + 1
if mn >= 60 then mn = 0
locate row, 4
print zerostring(mn, 2);
case 80 ' down
mn = mn - 1
if mn <= -1 then mn = 60
locate row, 4
print zerostring(mn, 2);
end select
end if
end if
loop
locate row + 1, 1
print "     ";
locate row + 1, 1, 1 ' show cursor
end function

function zerostring(n as integer, chars as integer) as string
dim s as string
s = ltrim$(rtrim$(str$(n)))
if len(s) < chars then
s = string$(chars - len(s), asc("0")) + s
end if
zerostring = s
end function
Logged
anarky
Been there, done that
*****
Posts: 1231


The Blobworld Comics King


« Reply #34 on: July 29, 2005, 07:53:51 PM »

Quote from: "Moneo"
anarky,

Thanks for your exhaustive analysis of the timezone exceptions in Australia. As you can well imagine, no one is going to want to program these hairy exceptions into his program for Australia and any other non-standard timezone --- even if he happens to live there.
*****


Well, I did. And when you see how, you'd wish you had thought of it. Only my arithmatic is coded. The rest is in a user editable database.

Format for database goes as follows:

<Offset>, <number of cities>
<"city1">....<"city(numcities)"> etc
...
loops

Only at this point it's still buggy, and fully testing it is not complete. Stay tuned. Within the next 24 hours it will be finished and online!

>anarky
Logged

Screwing with your reality since 1998.
Moneo
Na_th_an
*****
Posts: 1971


« Reply #35 on: July 29, 2005, 09:13:38 PM »

Quote from: "DrV"
Here's my entry (haven't really tested the actual logic, hope it works... have to get back to work Smiley ).  Only tested with FreeBASIC (if it doesn't work in QB, I can change it, if that is important).
Code:
'' tzconv.bas - timezone converter
'' 29-Jul-2005 - DrV - initial version.....

Brilliant program, DrV. Everything works great! Cheesy

I particularly like the way you made all the input fields to be menu selectable, avoiding all the input validation, which in my version cost me about 50 lines of code.

It definitely doesn't work in QB, causing 14 compile errors. I tried fixing it but still got errors caused by statements such as:
function pickzone(title as string) as integer
which give a syntax error.

If you would, I personally would like a QB version, basically so I can understand it. It might help other members as well.

Even though it's in FB, your solution is definitely a contender for winning this challenge.
*****
Logged
Moneo
Na_th_an
*****
Posts: 1971


« Reply #36 on: July 29, 2005, 09:28:34 PM »

Quote from: "anarky"
Quote from: "Moneo"
anarky,

Thanks for your exhaustive analysis of the timezone exceptions in Australia. As you can well imagine, no one is going to want to program these hairy exceptions into his program for Australia and any other non-standard timezone --- even if he happens to live there.
*****


Well, I did. And when you see how, you'd wish you had thought of it. Only my arithmatic is coded. The rest is in a user editable database.

Format for database goes as follows:

<Offset>, <number of cities>
<"city1">....<"city(numcities)"> etc
...
loops

Only at this point it's still buggy, and fully testing it is not complete. Stay tuned. Within the next 24 hours it will be finished and online!

>anarky


Sounds like you're turning this challenge into a thesis. Can't wait to see the final results. If the program uses a database, are you going to include the code to create and update this database? Otherwise, how can we test the timezone program?

BTW, how many cows are they milking in the dairy where you work? Do they milk twice or three times a day? What kind of equipment or setup do they have in the milking barn? In Australia, do you measure milk production by "pounds of butterfat" or by gallons or liters? What's your average daily production per cow? Just curious 'cause my family has a dairy, and I know enough to be dangerous.
*****
Logged
rpgfan3233
Ancient Guru
****
Posts: 617



« Reply #37 on: July 29, 2005, 11:35:48 PM »

Quote from: "Moneo"
It definitely doesn't work in QB, causing 14 compile errors. I tried fixing it but still got errors caused by statements such as:
function pickzone(title as string) as integer
which give a syntax error.


It's not too hard to convert to QB (I just did it). Mainly function name conversion is all that is needed.

Overall, nice program, DrV. It definitely could win this one. We'll have to see what response (and/or possibly modified code) Anarky comes up with.
Logged

974277320612072617420666C61696C21 (Hexadecimal for those who don't know)
DrV
Na_th_an
*****
Posts: 1553



WWW
« Reply #38 on: July 30, 2005, 01:37:13 AM »

Here's a version for QB (should still work in FB too); I made a few small aesthetic changes.

(I didn't feel like writing validation code, so I made sure the input was always valid. Smiley )

Code:
DECLARE FUNCTION pickzone% (title AS STRING)
DECLARE FUNCTION gmtoffsettostring$ (gmtoffset AS INTEGER)
DECLARE FUNCTION picktime% (title AS STRING, h AS INTEGER, m AS INTEGER)
DECLARE FUNCTION zerostring$ (n AS INTEGER, chars AS INTEGER)
'' tzconv.bas - timezone converter
'' 29-Jul-2005 - DrV - initial version
'' 29-Jul-2005 - DrV - modified to work with QB, plus some minor visual tweaks

''option explicit

DEFINT A-Z

tzdata:
DATA "London", 0
DATA "Reykjavik", -1
DATA "Greenland", -2
DATA "Rio de Janeiro, Brazil", -3
DATA "Santiago de Chile", -4
DATA "New York", -5
DATA "Chicago", -6
DATA "Denver", -7
DATA "Seattle", -8
DATA "Alaska", -9
DATA "Honolulu", -10
DATA "Midway Island", -11
'' no GMT - 12
DATA "New Zealand", 12
DATA "Solomon Islands", 11
DATA "Sydney", 10
DATA "Tokyo", 9
DATA "Hong Kong and China", 8 '' obsolete? Hong Kong is once again part of China..
DATA "Bangkok", 7
DATA "Omsk, Russia", 6
DATA "Karachi", 5
DATA "Stalingrad", 4
DATA "Moscow", 3
DATA "Cairo", 2
DATA "Berlin", 1

TYPE TimeZone
   place AS STRING * 22
   gmtoffset AS INTEGER
END TYPE

DIM SHARED zones(23) AS TimeZone

'DECLARE FUNCTION pickzone% (title AS STRING)
'DECLARE FUNCTION gmtoffsettostring$ (gmtoffset AS INTEGER)
'DECLARE FUNCTION picktime (title AS STRING, h AS INTEGER, m AS INTEGER)
'DECLARE FUNCTION zerostring$ (n AS INTEGER, chars AS INTEGER)

DIM i AS INTEGER, s AS STRING, n AS INTEGER
DIM localzone AS INTEGER, remotezone AS INTEGER
DIM localtime AS STRING
DIM h AS INTEGER, m AS INTEGER, d AS INTEGER
DIM number AS STRING

'' get data
RESTORE tzdata
FOR i = 0 TO UBOUND(zones)
   READ s, number
   n = VAL(number)
   zones(i).place = s
   zones(i).gmtoffset = n
NEXT i

localzone = pickzone("Local time zone  (arrow keys to select, Enter to accept)")
IF localzone = -1 THEN END
remotezone = pickzone("Remote time zone (arrow keys to select, Enter to accept) ")
IF remotezone = -1 THEN END

PRINT "Local time zone:  "; zones(localzone).place;
PRINT gmtoffsettostring$(zones(localzone).gmtoffset)
PRINT "Remote time zone: "; zones(remotezone).place;
PRINT gmtoffsettostring$(zones(remotezone).gmtoffset)
PRINT
PRINT "Enter local time (up/down keys to change field, left/right keys to select field, Enter to accept) (24-hour format)"
PRINT
IF picktime("Local time:", h, m) = -1 THEN END

'' calculate remote time
h = h - zones(localzone).gmtoffset
h = h + zones(remotezone).gmtoffset

IF h < 0 THEN
   d = -1
   h = h + 24
ELSEIF h > 23 THEN
   d = 1
   h = h - 24
END IF

PRINT
COLOR 7
PRINT "Remote time: "
COLOR 15
PRINT zerostring$(h, 2); ":"; zerostring$(m, 2); " ";
IF d < 0 THEN
   PRINT "-";
ELSEIF d > 0 THEN
   PRINT "+";
ELSE
   PRINT
END IF
IF d <> 0 THEN PRINT zerostring$(ABS(d), 1); " day"
COLOR 7
PRINT
PRINT "Press any key to exit..."
DO WHILE LEN(INKEY$) = 0
LOOP

DEFSNG A-Z
FUNCTION gmtoffsettostring$ (gmtoffset AS INTEGER)
   IF gmtoffset > 0 THEN
      gmtoffsettostring = "GMT +" + STR$(gmtoffset)
   ELSE
      gmtoffsettostring = "GMT -" + STR$(-gmtoffset)
   END IF
END FUNCTION

FUNCTION picktime% (title AS STRING, h AS INTEGER, m AS INTEGER)
DIM row AS INTEGER, hr AS INTEGER, mn AS INTEGER, ed AS INTEGER
DIM k AS STRING
   PRINT title
   COLOR 15
   row = CSRLIN
   hr = 0
   mn = 0
   ed = 0
   LOCATE row, 1, 0 ' hide cursor
   PRINT zerostring(hr, 2); ":"; zerostring(mn, 2)
   PRINT "^^";
   DO
      k = INKEY$
      IF LEN(k) = 1 THEN
         IF k = CHR$(10) OR k = CHR$(13) THEN
            h = hr
            m = mn
            picktime = 0
            EXIT DO
         ELSEIF k = CHR$(27) THEN
            picktime = -1
            EXIT DO
         END IF
      ELSEIF LEN(k) = 2 THEN
         IF ed = 0 THEN
            SELECT CASE ASC(RIGHT$(k, 1))
               CASE 77 ' right
                  ed = 1
                  LOCATE row + 1, 1
                  PRINT "   ^^";
               CASE 72 ' up
                  hr = hr + 1
                  IF hr >= 24 THEN hr = 0
                  LOCATE row, 1
                  PRINT zerostring(hr, 2);
               CASE 80 ' down
                  hr = hr - 1
                  IF hr <= -1 THEN hr = 23
                  LOCATE row, 1
                  PRINT zerostring(hr, 2);
            END SELECT
         ELSE
            SELECT CASE ASC(RIGHT$(k, 1))
               CASE 75 ' left
                  ed = 0
                  LOCATE row + 1, 1
                  PRINT "^^   ";
               CASE 72 ' up
                  mn = mn + 1
                  IF mn >= 60 THEN mn = 0
                  LOCATE row, 4
                  PRINT zerostring(mn, 2);
               CASE 80 ' down
                  mn = mn - 1
                  IF mn <= -1 THEN mn = 60
                  LOCATE row, 4
                  PRINT zerostring(mn, 2);
            END SELECT
         END IF
      END IF
   LOOP
   LOCATE row + 1, 1
   PRINT "     ";
   LOCATE row + 1, 1, 1 ' show cursor
END FUNCTION

FUNCTION pickzone% (title AS STRING)
DIM i AS INTEGER, s AS STRING
DIM k AS STRING
DIM curr AS INTEGER
   CLS
   LOCATE 1, 1, 0   ' hide cursor
   PRINT title
   FOR i = 0 TO 23
      LOCATE 2 + i, 3
      PRINT zones(i).place;
      LOCATE 2 + i, 3 + 30 + 1
      PRINT gmtoffsettostring(zones(i).gmtoffset);
   NEXT i
   curr = 0
   LOCATE curr + 2, 1
   PRINT ">";
   DO
      k = INKEY$
      IF LEN(k) = 1 THEN
         IF k = CHR$(13) OR k = CHR$(10) THEN
            pickzone = curr
            EXIT DO
         ELSEIF k = CHR$(27) THEN ' escape
            pickzone = -1
            EXIT DO
         END IF
      ELSEIF LEN(k) = 2 THEN
         SELECT CASE ASC(RIGHT$(k, 1))
            CASE 80, 77 ' down, right
               IF curr < UBOUND(zones) THEN
                  LOCATE curr + 2, 1
                  PRINT " ";
                  curr = curr + 1
                  LOCATE curr + 2, 1
                  PRINT ">";
               END IF
            CASE 72, 75 ' up, left
               IF curr > 0 THEN
                  LOCATE curr + 2, 1
                  PRINT " ";
                  curr = curr - 1
                  LOCATE curr + 2, 1
                  PRINT ">";
               END IF
         END SELECT
      END IF
   LOOP

exitfunc:
   CLS
   LOCATE 1, 1, 1 ' show cursor
END FUNCTION

FUNCTION zerostring$ (n AS INTEGER, chars AS INTEGER)
DIM s AS STRING
   s = LTRIM$(RTRIM$(STR$(n)))
   IF LEN(s) < chars THEN
      s = STRING$(chars - LEN(s), ASC("0")) + s
   END IF
   zerostring = s
END FUNCTION
Logged
Moneo
Na_th_an
*****
Posts: 1971


« Reply #39 on: July 30, 2005, 08:07:40 PM »

Quote from: "DrV"
Here's a version for QB (should still work in FB too); I made a few small aesthetic changes......


Your QB version also works 100%. Very nice work! Cheesy

So far you have the only completely working version. We'll wait a bit to see if the other participants can come up with a good version before announcing the winner.
*****
Logged
anarky
Been there, done that
*****
Posts: 1231


The Blobworld Comics King


« Reply #40 on: July 31, 2005, 05:33:57 AM »

http://www.qbasicnetwork.com/tz.zip
There's my entry with all notes etc. Should work in both FB and QB fine. Not tested in QB however.

Moneo, we have 1500 cows cycling year round in and out of production. We measure by KG of butterfat per litre. Tongue Using a 60 Milkaware rotary setup, we mikl at this time twice a day, but we are looking at three times a day. But with 1500 cows producing around 12-45 litres a day each, it is going to be a tough run. Hopefully, we will stay on two milkings a day.

Did you know that a herd of cattle will eat 75% of a paddock within the first 45 minutes of them being in there?

Tongue You think you are dangerous? Wait until I have to give you a 4in1 after calving!

>anarky - Out to tea
Logged

Screwing with your reality since 1998.
Moneo
Na_th_an
*****
Posts: 1971


« Reply #41 on: July 31, 2005, 08:32:53 PM »

anarky,

I don't understand your measurement of kg. of butterfat per liter. The dairies I'ver seen in the States all measure a particular cow's production by pounds of butterfat per day. Here in Mexico they measure by liters per day. So, one is by weight and the other is by volume. What you said sounds like mixing weight and volume. Can that be true?

Your rotary setup for milking 60 cows at a time sounds great.

What do you mean by "a 4in1 after calving"?

By 1500 production cows I assume you mean 1500 "fresh" cows. So then you're actually milking about an average of 1000 cows per day, no?

If you go to 3 milkings a day, the life of your cows will diminish because you'll knock the heck out of the poor honeys. If you do that, then you'll problably beef a cow after 3 lactations, which becomes expensive unless you're also in the business of raising springers to replenish your herd.

BTW, with production up to 45 liters a day, you must be milking Holsteins, no?

Have you guys in Australia had any problems with a cow disease called Leucosis?

It's really a pleasure talking dairy cows with someone who knows!
*****
Logged
Moneo
Na_th_an
*****
Posts: 1971


« Reply #42 on: July 31, 2005, 09:13:16 PM »

Quote from: "anarky"
http://www.qbasicnetwork.com/tz.zip
There's my entry with all notes etc. Should work in both FB and QB fine. Not tested in QB however....


I did some testing with your FB version. It's very hard to test because you did not adhere to the specifications for the following:

1) Program does not allow entering the TO timezone as a GMT. You have to know what city is in what timezone.

2) Program does not allow entering the time. It defaults to the system time on the user's PC.

As a result, I was only able to test a few combinations, which did work, however.

BTW, the program does not compile in QB. It doesn't  like "?" instead of PRINT.
*****
Logged
rpgfan3233
Ancient Guru
****
Posts: 617



« Reply #43 on: August 01, 2005, 12:29:16 AM »

Quote from: "Moneo"
What you said sounds like mixing weight and volume. Can that be true?

I'm not a dairy person or a person of any sort for that matter. . .

I'm not sure about this, but perhaps it IS measured in litres ("12-45 litres per day for each [cow]"). Then, the butterfat is weighed in KG?

Combination of volume and weight sounds probable, though the reason for doing it evades me.
Logged

974277320612072617420666C61696C21 (Hexadecimal for those who don't know)
Moneo
Na_th_an
*****
Posts: 1971


« Reply #44 on: August 01, 2005, 01:08:57 AM »

Quote from: "rpgfan3233"
Quote from: "Moneo"
What you said sounds like mixing weight and volume. Can that be true?

I'm not a dairy person or a person of any sort for that matter. . .

I'm not sure about this, but perhaps it IS measured in litres ("12-45 litres per day for each [cow]"). Then, the butterfat is weighed in KG?

Combination of volume and weight sounds probable, though the reason for doing it evades me.

Using both volume (liters) and weight (butterfat) would make sense. The problem is that herd management systems would need to compute and carry both measures. The systems I've seen carry one or the other.

The volume is easy to understand. The weight in pounds of butterfat is a bit tricky. In the USA they are more concerned with how much butterfat is in a particular cow's milk. The higher the butterfat content the more acceptable and sellable is the milk, i.e., quality over volume. If a cow is not of the best breed, or not in the best of health, then her milk would be lower than average in butterfat.

A regular grade (not registered) cow will have about 3.3 to 3.5% of butterfat. Registered cows will get as high as 3.8%.
*****
Logged
Pages: 1 2 [3] 4
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!